Skip to content

TEST-001A3 — Stabilize the untrusted Error recapture assertion across Node 20 platforms #187

Closed

Description

@daliu

Outcome

Repair one test-only portability defect that blocks a clean macOS Node 20 verification while the same exact main commit passes hosted Linux Node 20.

Exact claim

CLAIMED by /root at 2026-07-13T22:19:02Z on codex/issue-187-request-validation-stack-test, based on exact main 5c7d2d160237465b367c4dcc799cefcfab1e4e9b.

Owned path only:

  • functions/requestValidation.test.js

Excluded: functions/requestValidation.js, all runtime, package/lockfiles, CI/deploy workflows, Rules, frontend, docs, providers, and production.

Reproduction and corrected invariant

On exact main with Node 20.20.2 on macOS, the test expects Reflect.set(fabricated, 'stack', canary) to return false. Inside Jest's VM, V8 returns true and the special lazy Error stack accepts the value even though Object.isFrozen(fabricated) is true. The exact same commit passed hosted Linux run 29288647739 with 990 Functions tests.

The caller-constructed error is deliberately untrusted. Production parseBoundedArray does not recognize it in the private safe-error WeakSet, does not reuse it, and emits a fresh fixed validation error. That recapture, fixed reason/message, empty serialization, distinct identity, and canary-free stack are the portable security properties. This test-only correction must not pretend the untrusted input itself is immutable on every V8 host.

Acceptance

  • Do not change production source.
  • Preserve the class freeze assertion and fixed message mutation assertion.
  • Attempt the hostile stack mutation without relying on an engine-specific return value or untrusted-input state.
  • Prove the parser returns a distinct, fresh fixed error with the expected safe reason/message, empty serialization, and no hostile canary in its stack.
  • Run the focused test and complete Functions suite on macOS Node 20.20.2.
  • Pass exact hosted Linux Functions CI.
  • Record that no website, Firebase, Stripe, provider, or production behavior changed.

Officer impact: None — test portability only.

Officer documentation: None — no officer task or public behavior changes.

Deployment evidence: Test/merge evidence only; no deployment or provider action.

Activity

  1. self-assigned this
    on Jul 13, 2026
  2. added
    priority:P1High-priority follow-up
    area:ciContinuous integration and deployment
    size:XSOwner decision or very narrow change
    status:in-progressClaimed and actively being implemented
    type:testingTest infrastructure and quality gates
    on Jul 13, 2026
  3. changed the title [-]TEST-001A3 — Stabilize the frozen Error-stack assertion across Node 20 platforms[/-] [+]TEST-001A3 — Stabilize the untrusted Error recapture assertion across Node 20 platforms[/+] on Jul 13, 2026
  4. daliu commented on Jul 13, 2026

    @daliu
    ContributorAuthor

    Focused evidence corrected the premise before commit: Jest/V8 on macOS can mutate the special lazy Error.stack slot despite Object.isFrozen, while hosted Linux returns false. The issue now tests the actual portable trust boundary: the fabricated error is untrusted, the parser emits a distinct fixed safe error, and the hostile canary is absent. Runtime remains excluded.

  5. daliu commented on Jul 13, 2026

    @daliu
    ContributorAuthor

    COMPLETE/CLAIM RELEASED at 2026-07-13T22:28:48Z. PR #188 merged after exact reviewed head 5004389 as main 28681ef. Local Node 20.20.2: focused 152/152, Functions 990 passed with 32 skipped, lint and diff checks passed. Three independent reviews approved. PR CI 29289800970 and post-merge CI 29289912751 passed all five GitHub jobs, including the Linux Functions suite. This changed one test file only. No runtime, website, Firebase, Stripe, provider, production, or deployment behavior changed. The file claim is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:ciContinuous integration and deploymentpriority:P1High-priority follow-upsize:XSOwner decision or very narrow changetype:reliabilityReliability and recoverytype:testingTest infrastructure and quality gates

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions