Skip to content

fix(audit): preserve env shebang argument ownership - #14075

Merged
vincentkoc merged 4 commits into
morluto:mainfrom
Afloat16:fix/env-shebang-operands-20261123
Nov 30, 2026
Merged

vincentkoc merged 4 commits into
morluto:mainfrom
Afloat16:fix/env-shebang-operands-20261123

Conversation

@Afloat16

@Afloat16 Afloat16 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fix Node shebang classification when env options own operands. The release-exposure audit now finds embedded source maps behind grouped -u, -C, -P and GNU -a/--argv0 forms. An environment assignment ends option parsing, so a later dash-prefixed word remains the selected command.

The shared parser keeps env -S quoting, variable uncertainty and the existing static file-read boundary. Scanned script bytes are not executed or changed. No separate issue is linked; the PR includes its reproduction and fix.

Validation

  • Current head: 87c0ce27ea4b655b6aad994a35817e072851cab6, integrated with pinned main aeea7c25ede5c5e6b16198e60c0eb0475ff6f5d8.
  • Canonical P2 review identified the missing GNU argv0 operand. The current head adds both spellings and grouped/attached coverage at the existing argument owner.
  • All 20 direct Node 24.22.1 parser controls passed, including assignment boundaries, argv0 operands and options that consume a Node-looking word without selecting Node.
  • Exact-head hosted CI passed: reader and compiled CLI regressions, source-map findings, exit status, unchanged input bytes, static/documentation checks and Linux package baseline. The contributor's Linux GNU-env oracle remains prior-head evidence.
  • Formatting and diff checks passed. The worktree has no qualified dependency installation; no local full-suite or macOS GNU-env execution is claimed.

Author readiness

Human owner: @Afloat16

  • 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.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

@greptile-apps

greptile-apps Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no actionable defects were found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable defects were found.

Summary

Corrects how the release audit identifies Node scripts launched through env.

  • Release audits now find Node scripts behind grouped env -S options.

No actionable defects or new security issues were found. Tests were not run during this review. The check for a superseding PR could not complete because GitHub authentication was unavailable.

Reviews (4) · Last reviewed commit: "fix(config): consume env argv0 operands ..." · Reviewed by Greptile

@Afloat16
Afloat16 marked this pull request as ready for review November 24, 2026 10:20
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-24T10:20:14.171778Z
We couldn’t complete this review. Comment @codex review to try again.
a7dd868 Draft marked ready
ℹ️ 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@morluto morluto added area: tests Test suite and verification bug Something isn't working labels Nov 26, 2026

@vincentkoc vincentkoc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! One operand case remains: GNU env’s -a/--argv0. For example, #!/usr/bin/env -S -ia custom node still hides inline source maps because custom is treated as the program. The same operand handling and regression cases should cover these forms before merging.

…4075-env-argv0

* commit 'aeea7c25ede5c5e6b16198e60c0eb0475ff6f5d8': (738 commits)
  fix(hopper): clarify publisher verification failures
  fix(analysis-view): keep PTX text pages on Unicode boundaries (morluto#15222)
  feat(mcp): advertise each tool's family in tools/list _meta (morluto#7154)
  perf(evidence): inspect retained records without building a bundle (morluto#15219)
  fix(process): report denied inspection as typed cleanup failures (morluto#9261)
  perf(mcp): complete retained Evidence without rebuilding bundles (morluto#15210)
  fix(agentenv): stop dry-run tarball reads on cancellation (morluto#15205)
  perf(png): reuse scanline storage in screenshot comparisons (morluto#15215)
  fix(javascript): respect Node HTTP path validation (morluto#9684)
  fix(windows): reject native addons with unusable delay-import tables (morluto#15216)
  feat(artifacts): inventory Android super image metadata (morluto#14928)
  fix(paths): reject dotted console device names for portability (morluto#15220)
  fix(analysis-view): return continuation for GPU pages at the byte limit (morluto#15206)
  fix(screenshots): report the PNG comparison memory allowance (morluto#15217)
  fix(process): compare Windows server paths by native realpath (morluto#15044)
  fix(firmware): recheck decoded member source on completion (morluto#15211)
  fix(artifacts): check signed BC4 and BC5 DDS payload extents (morluto#15208)
  fix(artifacts): bound embedded GLB images by the declared buffer length (morluto#15207)
  perf(ci): confirm test-only macOS selection on Linux (morluto#15203)
  fix(paths): reject Windows console device names (morluto#14972)
  ...
@vincentkoc
vincentkoc merged commit 7485377 into morluto:main Nov 30, 2026
41 checks passed
@vincentkoc

Copy link
Copy Markdown
Collaborator

Thanks! Merged with the argv0 operand cases included, after the review fixes and green CI.

vincentkoc added a commit to agnaylor/rea that referenced this pull request Nov 30, 2026
…410-windows-transport

* commit '28772e67d245661b4a66ef5a09353eafda483367': (674 commits)
  docs: note symlink EPERM in Windows source test failures (morluto#7211)
  fix(javascript): scope candidate this event receivers (morluto#4656)
  fix(config): validate target and loader options before printing MCP registrations (morluto#9279)
  fix(native): honor cancellation during PE alias expansion (morluto#9063)
  fix(audit): preserve env shebang argument ownership (morluto#14075)
  feat(evtx): inventory Windows event log records offline
  docs(skill): replace the staged workflow with the rules it encodes (morluto#10374)
  fix(hopper): clarify publisher verification failures
  fix(analysis-view): keep PTX text pages on Unicode boundaries (morluto#15222)
  feat(mcp): advertise each tool's family in tools/list _meta (morluto#7154)
  perf(evidence): inspect retained records without building a bundle (morluto#15219)
  fix(process): report denied inspection as typed cleanup failures (morluto#9261)
  perf(mcp): complete retained Evidence without rebuilding bundles (morluto#15210)
  fix(agentenv): stop dry-run tarball reads on cancellation (morluto#15205)
  perf(png): reuse scanline storage in screenshot comparisons (morluto#15215)
  fix(javascript): respect Node HTTP path validation (morluto#9684)
  fix(windows): reject native addons with unusable delay-import tables (morluto#15216)
  feat(artifacts): inventory Android super image metadata (morluto#14928)
  fix(paths): reject dotted console device names for portability (morluto#15220)
  fix(analysis-view): return continuation for GPU pages at the byte limit (morluto#15206)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: tests Test suite and verification bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants