Dev.to Security ๐Ÿ” Cybersecurity ๐Ÿ‘ 0 ๐Ÿ“– 5 min read

Anatomy of the 730,000-Record Korea Post Leak: Stopping Sequential ID & Session Enumeration at the API Gateway

On November 30, 2026, South Korea's postal service (Korea Post / ePost) confirmed a breach in which the names, physical addresses, and phone numbers of more than 730,000 users were exfiltrated (Yonhap News report). The i

On November 30, 2026, South Korea's postal service (Korea Post / ePost) confirmed a breach in which the names, physical addresses, and phone numbers of more than 730,000 users were exfiltrated (Yonhap News report). The incident landed days after similar disclosures at financial and public portals, and it repeats the most exploited vulnerability class in high-traffic citizen services: broken object level authorization (BOLA, OWASP API1) combined with lookup endpoints that accept a predictable identifier and return a full profile.

The interesting part for engineers is not the number. It is the shape of the attack: no credential stuffing, no insider, no exotic exploit. An endpoint that answered the question "give me record number N" for anyone who asked, fast enough, from enough addresses.

1. Why per-IP rate limits do not stop enumeration

A parcel-tracking or address-book endpoint usually accepts a numeric address_seq or an unverified order/phone parameter and returns a shipping profile. Per-IP throttles assume an attacker is one noisy client. Distributed enumeration is not.
Rotate residential proxies at two requests per minute per IP across 5,000 nodes and the aggregate rate is 10,000 requests per minute while every individual IP stays comfortably under the threshold. At that pace 730,000 records leave in under two hours, and the WAF dashboard shows nothing but a flat line of compliant traffic.

Two properties make this possible, and both are architectural choices rather than bugs:

  • The identifier is guessable. Sequential integers are enumerable by definition.
  • The endpoint is unauthenticated or under-authenticated. Any caller can read any object as long as they know or guess the key.

Rate limiting is a volume control. Enumeration is a coverage problem, and coverage is bounded by authorization, not by request count.

2. Bind every object to the principal with an HMAC token

The first structural fix is to stop exposing raw database keys. Client-facing payloads should carry an opaque token that is cryptographically bound to the authenticated principal, so that a token issued to session A cannot resolve an object owned by B.

import hmac
import hashlib
import base64

def issue_bound_object_token(secret_key: bytes, user_sub: str, object_id: str) -> str:
    msg = f"{user_sub}:{object_id}".encode("utf-8")
    sig = hmac.new(secret_key, msg, hashlib.sha256).digest()[:16]
    body = base64.urlsafe_b64encode(sig).decode("utf-8").rstrip("=")
    return f"{object_id}.{body}"

def resolve_bound_object_token(secret_key: bytes, user_sub: str, token: str) -> str:
    if "." not in token:
        raise PermissionError("malformed object token")
    object_id, _ = token.split(".", 1)
    expected = issue_bound_object_token(secret_key, user_sub, object_id)
    if not hmac.compare_digest(token, expected):
        raise PermissionError("BOLA violation: token not bound to active principal")
    return object_id

Two implementation notes matter more than the snippet. Keep the signing secret out of the application image and rotate it on a schedule shorter than your session lifetime, so a leaked token has a bounded life. And treat a verification failure as an authorization event worth an alert: an account that submits foreign object tokens has told you exactly what it is doing.
For genuinely public lookup pages, such as a tracking page that must work without login, bind the token to a one-time nonce issued with the page and burned on first use. The caller then holds a capability for one record, not a key to the table.

3. Count distinct objects, not requests

The second fix changes what you measure. Counting HTTP requests per IP is cheap and nearly useless. Counting distinct object identifiers touched per principal is both cheap and decisive.

Maintain a Redis HyperLogLog per session (or per ASN subnet for anonymous public pages) over a sliding five-minute window and revoke the session when cardinality crosses a threshold:

import redis, time

r = redis.Redis()

def touch_object(session_id: str, object_id: str, limit: int = 15) -> None:
    key = f"objcard:{session_id}:{int(time.time() // 300)}"
    r.pfadd(key, object_id)
    r.expire(key, 600)
    if r.pfcount(key) > limit:
        raise PermissionError("enumeration detected: distinct object cardinality exceeded")

A normal user checks one to three addresses. An enumeration script touches fifty or more. The distinction does not care how many IP addresses the script owns, because it is keyed on the principal and the objects, not on the network.

Add a second signal for anonymous pages: the ratio of distinct objects to distinct sessions per ASN. A single subnet resolving hundreds of unrelated records in minutes is not a family checking parcels.

4. Respond with less

Enumeration is only profitable because the response is generous. A lookup endpoint that returns the full shipping profile - name, address, phone, order history - turns one successful guess into a complete record.

Return the minimum that satisfies the user's intent. For tracking, that is a status and a masked recipient name. Derive the mask server-side, and never send the full phone number to a page that displays four digits. Anything more requires step-up verification against the account that owns the order.

This is the same principle as PII redaction at the ingress proxy: the cheapest data breach is the one where the field was never in the response.

5. Make the guardrails part of the contract

Technical controls decay unless the organization keeps asking for them. Three habits keep them alive:

  1. Object authorization tests in CI. For every resource endpoint, assert that a token issued for user A returns 403 for an object owned by user B. BOLA is a test, not a code review opinion.
  2. An enumeration runbook. When the cardinality alert fires, someone must be able to revoke sessions, rotate the token secret, and pull the affected object list within the hour.
  3. A disclosure rehearsal. The 730,000 figure was published because the agency could enumerate exactly which records were read. Systems that cannot answer that question during an incident answer it with a much larger number later.

Checklist

  • No sequential or raw primary keys in client payloads; opaque, principal-bound tokens instead
  • HMAC or AEAD verification on every object read, with failures logged and alerted
  • Cardinality limits on distinct objects per session and per subnet, not just request rate
  • Minimum-necessary response fields; masking applied server-side
  • Step-up verification for anything beyond public status
  • Automated cross-tenant authorization tests in the pipeline
  • Rotation, revocation, and record-level forensics ready before the incident The Korea Post case is not unusual for what the attackers did. It is unusual only in how completely a predictable identifier plus an unauthenticated lookup reproduced a customer database. Both halves are design decisions, and both are fixable at the gateway without touching the data model.

You can inspect HTTP header hygiene, JWT claims, and payload structures locally in your browser at DOLIT English Engineering Hub, where all parsing runs in client memory with no server-side logging.

๐Ÿ“ฐ Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes โ€” full credit and traffic to the original publisher.