Skip to content

fix(elf): validate section-name backing before decode budget - #12449

Merged
morluto merged 1 commit into
mainfrom
audit/elf-debuglink-name-span
Nov 19, 2026
Merged

morluto merged 1 commit into
mainfrom
audit/elf-debuglink-name-span

Conversation

@morluto

@morluto morluto commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Summary

ELF debug-link inspection previously read a second copy of the section-name table declaration to enforce the caller's decode budget. That check treated an unbacked span or non-string section as a valid compression header, then reported a capacity refusal. The shared section-directory reader now applies the caller's decode budget after it validates the declared type and file extent. It still checks the decoded size before inflation and keeps the existing structural allowance.

The image and candidate use the same directory boundary. ELF notes and the directory now share the typed source-plus-decoded-name limit and its existing recovery fields.

Validation

Both authored fixtures failed before the fix with a limit error and now report a format error without inflation. Existing controls passed for genuine decoded-size limits, candidate limitations, unsupported compression, and extended section numbering. All 672 tests passed with one existing skip across 14 CI-selected suites. check:fast and diff checks passed.

Author readiness

Human owner: @morluto

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T17:38:53.396320Z 54dd05a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issues were found.

Summary

Moves the ELF section-name decode budget into the shared directory reader, after it checks the section type and file range.

  • ELF inspection validates section-name tables before applying the decode budget.

No actionable issues found. Tests were not run during this review.

Reviews (2) · Last reviewed commit: "fix(elf): validate section-name backing ..." · Reviewed by Greptile

@morluto

morluto commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

#12416 overlaps the shared ELF codec and section reader. This PR moves the caller budget into the owner that has already validated the table declaration. Its regressions use zlib and cover an unbacked span and a non-string section. Please retain those outcomes when aligning #12416's synchronous and cooperative decode paths.

@morluto
morluto enabled auto-merge (squash) November 19, 2026 17:40
@morluto
morluto merged commit 0b12a65 into main Nov 19, 2026
42 checks passed
@morluto
morluto deleted the audit/elf-debuglink-name-span branch November 19, 2026 18:03
@morluto morluto added area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant