Skip to content

External boundary leaks the E400 escape pair into child env/argv (decode_raw_byte_markers_to_byte_chars lacks the LITERAL_CHAR_ESCAPE arm) #2881

Closed

Description

@caomengxuan666

Summary

Values containing a typed registry-zone char reach real child processes as the U+E400 + char escape pair instead of the raw char. GNU passes the raw char.

  • v=$'\uE314'; /usr/bin/env (with v exported) → child env carries U+E400 U+E314; GNU: raw U+E314.
  • Same for argv: v=$'\uE314'; /usr/bin/printf '%s' "$v" receives the pair.

Found by the #2879 systematic carrier-protocol sweep (battery cells c08/c09, byte-verified vs GNU bash 5.3.20; captain spot-verified the root asymmetry in the source).

Root cause

decode_raw_byte_markers_to_byte_chars (src/executor/substitution_metadata.rs) — the decoder used at the external boundary — has no LITERAL_CHAR_ESCAPE (U+E400) arm: it handles only U+E000 pairs and passes E400 pairs through untouched. Its sibling decode_raw_byte_markers has the arm. Codegraph caller set for the deficient function is exactly 3, all external boundaries:

  • src/executor/path.rs:1716 (child argv)
  • src/executor/external_inner.rs:4548 (env builtin environment)
  • src/executor/readonly_functions.rs:466 (child_env_value)

Fix destination (1.5.1, simple fix — sweep item E1)

Add the LITERAL_CHAR_ESCAPE arm to decode_raw_byte_markers_to_byte_chars, mirroring the sibling, plus a parity test asserting both raw-byte decoders agree on all registry inputs. Class (e) leak to external processes — the #1620 family.

Regression seed: sweep battery cells c08/c09 (~/workspace/pua-audit/probes/run_battery.py in the audit workdir) — pin as in-repo tests against a real child binary.

Metadata

Metadata

Labels

area:expansionbuggnu-baseline

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions