Skip to content

fix(storage): reject embedded IPv4 rebinding hosts - #1112

Draft
seonghobae wants to merge 10 commits into
mainfrom
cursor/reject-embedded-ip-rebinding-hosts-206f
Draft

fix(storage): reject embedded IPv4 rebinding hosts#1112
seonghobae wants to merge 10 commits into
mainfrom
cursor/reject-embedded-ip-rebinding-hosts-206f

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Buyer-visible gap

#1030 at ed8d782c already requires DNS pinning, rejects helper suffixes such as .nip.io, and couples consumed to explicit zero retention. Rebinding hostnames that are not those helper TLDs still passed is_exact_dns_host:

  • dotted embeds such as 169.254.169.254.attacker.example
  • 32-bit decimal/hex aliases such as 2851992574.attacker.example
  • hyphenated A-B-C-D / ip-A-B-C-D labels such as 169-254-169-254.attacker.example and ip-169-254-169-254.ec2.internal

A later TTL or attacker-controlled suffix can still point an allowlisted name at link-local metadata.

What this PR adds

  • Reject four consecutive octet labels that form a dotted IPv4 address anywhere in the hostname
  • Reject a single decimal or 0x hexadecimal label that encodes a 32-bit IPv4 address (> 255 and <= 0xFFFFFFFF)
  • Reject hyphenated IPv4 labels and the AWS ip-A-B-C-D form
  • Keep ordinary octet DNS labels such as 1.s3.amazonaws.com and non-octet hyphen labels such as 1-2-3.example.com valid
  • Integers above 0xFFFFFFFF are not treated as IPv4 aliases

Naruon remains the adapter owner (ContextualWisdomLab/naruon#1364). Do not close #1019 until that consumer's current-head write/read/delete lane is green.

Verification

Local coverage run -m pytest tests && coverage report --fail-under=100 (1190 passed) and interrogate both passed at 100%.

Merge

Successor to #1030. Do not merge #1030 at ed8d782c without this embedding check. Do not self-approve.

Open in Web Open in Cursor 

seonghobae and others added 9 commits August 16, 2026 20:07
Close the buyer-visible gap where each product could invent S3 or
S3-compatible endpoint, credential, encryption, integrity, retention,
and rollback rules. Central .github now owns a provider-neutral
object_storage policy plus a fail-closed validator; Naruon keeps its
adapter (ContextualWisdomLab/naruon#1364).

Closes #1019
Reject localhost, metadata, IPv4, Unicode, and case-alias hosts; bound
TCP ports; refuse non-finite JSON; close nested schema objects; and
fail closed on malformed observability labels without TypeError.
The one-shot repair workflow already applied its hardening and would
fail or revert ARCHITECTURE.md if rerun. Removing it clears the
Scorecard Token-Permissions finding on workflow-default contents: write.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Strix proved decimal IPv4 hosts such as 2851992574 passed
is_exact_dns_host under an explicit allowlist. Reject IP literals,
decimal aliases, hexadecimal aliases, and dotted-numeric names.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Reject multicast .local, metadata, and cluster-local names from exact
allowlists, and reject RFC 6761/6762 internal suffixes when private-network
trust is denied. Require tenant-purpose binding, align the portable schema
with the executable values, and add the product write/read/delete acceptance
template so sibling adapters can prove compatibility.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Close the remaining #1019 SSRF holes on the
object-storage contract: pin resolved addresses, reject DNS-rebinding
helper suffixes, and deny Kubernetes .svc names unless explicitly named.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Helper-TLD denylists still admitted 169.254.169.254.attacker.example and
32-bit decimal or hex aliases under an ordinary suffix. Fail closed on
those embeddings while keeping single octet DNS labels valid.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b14da0c3-68c6-4eb8-a606-0973ddec2c88

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

nip.io-style A-B-C-D and AWS ip-A-B-C-D labels still passed the dotted
embed check. Treat those labels as rebinding hosts while leaving
three-part or non-octet hyphen labels valid.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Govern S3 and S3-compatible object-storage contracts across CWL

2 participants