Repository navigation
security(workforce-validation): close tuple.__new__ bypass on component-resolution issuance #415
Description
Finding
Fresh review of canonical Workforce Validation PR #235 found that #413 closed the ordinary public constructor for FinalWeightComponentEvidenceResolution, but the proof-bearing type still subclassed tuple. Python's built-in tuple.__new__(FinalWeightComponentEvidenceResolution, raw_items) bypassed the class __new__ method and could mint an exact runtime instance without calling corroborate_final_weight_component_evidence(...).
That bypass recreated the issuance problem #413 was intended to close. A caller could manufacture the same exported success runtime type without exact final-weight/binding identity, owner reads, native owner scope checks, construction/use chronology, purpose-bound authorization, or the exact final-receipt audit target. This is distinct from the #410/#412 canonicalization of owner-returned projections: the vulnerable object was the proof-bearing corroboration result itself.
Ordinary-forward repair
ceb7f4b0b993e24729e2805cd09c647ff0c5bc1e— source-first RED:tuple.__new__(FinalWeightComponentEvidenceResolution, (base, ()))must raise rather than mint proof-bearing success.5a67b2c07414a79a9b580180b56991ff6ec79156— causal repair: the proof-bearing result is no longer a tuple subclass. It is a slotted immutable class whose public__new__remains non-issuing; the private issuer allocates withobject.__new__, writes canonical evidence into private slots, and seals the object with a module-private issuance marker only after canonicalization.e38909985e604e0ba605f22944f39334b2aa9f08— edge hardening: genericobject.__new__allocation may create an uninitialized exact runtime object, but proof-property access fails closed withFinalWeightComponentEvidenceIntegrityErrorunless the canonical issuer sealed it.- current
ab7a968e0109176f0d5862373d0a15d3f1832e92— explicit issued-result immutability regression: a normally corroborated result rejects public attribute mutation/deletion while preserving normal property reads.
These commits are source-established evidence only until current exact-head hosted acceptance completes. This repair closes the concrete built-in tuple-constructor bypass under the repository's in-process boundary model; it does not claim cryptographic unforgeability against arbitrary code execution with unrestricted Python introspection.
Required contract
- A public or built-in low-level tuple constructor must not be able to mint a usable
FinalWeightComponentEvidenceResolution. - The proof-bearing result must not rely on tuple-subclass constructor semantics for issuance.
- The canonical corroborator remains the only supported production issuer after science(workforce-validation): bind final-weight lineage to exact typed component receipts #411/security(workforce-validation): bind component projections to tenant and validity-study authority #412/security(workforce-validation): authorize component-evidence resolution before owner reads #414 validation and authorization.
- Returned base/adjustment projections remain canonical value-minimized evidence; this repair does not widen fields or change scientific semantics.
- If an uninitialized exact result object is manufactured through generic Python object allocation, access to proof-bearing properties fails closed unless the canonical issuer sealed the object.
- A canonically issued result remains immutable through the public mutation surface.
- Durable feat(workforce-validation): adopt registry into owner persistence #248 adoption must consume the canonical corroboration API rather than type-only or tuple-shape assertions.
Completion boundary
Do not close for source repair alone. Exact-head owned tests/docstring/edge coverage, installed-wheel/package/PostgreSQL/security gates, qualifying independent review, normal protected integration, and durable #248 adoption remain required.
Activity
seonghobae commentedon Sep 19, 2026
Fresh current-head refinement: #415 correctly removed the
tuple.__new__alternate issuer and made unsealed raw allocations fail closed, but the seal identity itself remains module-global. #422 now tracks that separate capability defect. REDa27f50d12ccca27ca3b6c0e4a184fc32e1a31888proves ordinary code can otherwise copy_RESOLUTION_ISSUANCE_MARKERinto an exact raw result after populating canonical proof slots. Preserve #415's non-tuple/immutability/canonicalization repair; completion now also requires #422 to move sealing authority out of ordinary module state and reacquire exact-head evidence.