Skip to content

fix(elf): reject invalid section table and zlib declarations - #12193

Merged
morluto merged 2 commits into
mainfrom
audit/elf-section-admission
Nov 19, 2026
Merged

morluto merged 2 commits into
mainfrom
audit/elf-section-admission

Conversation

@morluto

@morluto morluto commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

The ELF readers could report complete section data from three malformed declarations. The shared table reader now rejects section counts that must use extended numbering. The shared compression reader validates decoded alignment before inflation and checks that the zlib stream consumes the declared payload.

The refreshed implementation covers #10149, #9330, and #10148. Thanks to @wunianze666-netizen for the original reports and controls. The readers retain their existing caller budgets and error projection. Zlib accounting uses Node's existing consumed-input result across supported Node releases.

The carrier follow-up from #12196 applies the same section count admission before Dart, Deno, and Node SEA use section rows. Node SEA still uses an independently valid program note when it needs no section fallback. Deno preserves its existing format-error classification for confirmed carriers with damaged section metadata.

Validation

  • Five malformed fixture cases failed before the fix and passed afterward. Controls cover canonical extended numbering, valid alignment, and exact zlib payloads.
  • Compiled CLI probes rejected all three malformed cases, accepted the valid fixture, and preserved the input bytes.
  • The initial section-reader change passed 313 focused source, CLI, MCP, and GPU tests with one platform skip. npm run check:fast and git diff --check passed.
  • Carrier validation passed 294 source tests with one existing skip and 35 compiled CLI/MCP tests. Four baseline cases failed before the change. The parent squash has the same tree as the validated carrier head.
  • Validation used authored binaries and local readers. Provider-specific ELF loading was outside this run.

References ELF gABI Sections and RFC 1950.

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-19T05:03:08.086629Z 31d635e New commits
ℹ️ 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 reviewed changes appear safe to merge.

Summary

The PR tightens ELF section-table and compressed-section checks, then shares section-count checks with Deno, Node SEA, and Dart readers.

  • ELF readers reject reserved direct section counts.
  • Compressed section names require valid alignment and a fully consumed zlib payload.

No new actionable issues or rule violations found. No superseding fix appeared in the available base-branch history. Tests were not rerun during this review.

Reviews (2) · Last reviewed commit: "fix(elf): share section count admission ..." · Reviewed by Greptile

fix(elf): admit section tables before carrier recognition
@morluto
morluto enabled auto-merge (squash) November 19, 2026 05:04
@morluto
morluto merged commit 45768a2 into main Nov 19, 2026
44 checks passed
@morluto
morluto deleted the audit/elf-section-admission branch November 19, 2026 05:20
@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