Canonicalize tempfile._os/_sys re-exports in component code scanner

fix(security): canonicalize tempfile._os/_sys re-exports in component code scanner (#15190)
Canonicalize tempfile._os/_sys re-exports in component code scannerda5727-fix-canonicalize-tempfile-os-sys-re-exports-in-cve-2026-33873fixcanonicalize tempfile sys exports component code

Committed by erichare

commit message
fix(security): canonicalize tempfile._os/_sys re-exports in component code scanner (#15190)

The assistant code-security scanner only canonicalized stdlib re-export
hosts whose attribute name equals the module name (glob.os, logging.os,
...). tempfile imports os and sys under the private aliases _os/_sys, so
tempfile._os.system resolved to the unmatched name 'tempfile._os.system'
and bypassed the dangerous-call checks, allowing model-generated code to
reach os.system during runtime validation.
 
Turn _RESTRICTED_MODULE_REEXPORTS into a member->canonical-module mapping
and add tempfile's _os/_sys aliases (LE-2674, H1-3994085, bypass of
CVE-2026-33873 / GHSA-v8hw-mh8c-jxfc).

Editor assessment

This commit patches CVE-2026-33873. The subject and body together explain a subtle bypass: the scanner canonicalized only re-exports whose attribute matched the module name, so the tempfile _os and _sys aliases escaped the dangerous-call checks and allowed os.system reachability. The body then describes replacing the restricted-module set with a member-to-module mapping and adding the aliases. That is strong technical writing, undercut by a security scope that labels a category rather than a module, and by a header near a hundred characters with the PR number appended. The trailing ticket and advisory references sit inline rather than as footers. The reasoning is clear, yet the formatting choices cap how exemplary it can be.

Browse categories

More fix examples · Back to search