镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Annex B: securely seed legacy function-name membership #760

Closed

Description

@chrisbbreuer

Parents: #493, #496
Related: #759

Problem

Sloppy Script/function evaluation scans block-level Annex B function declarations and stores every source-controlled identifier in std.StringHashMapUnmanaged. Its process-predictable default context lets hostile source precompute collision-heavy candidate names and inflate legacy-binding classification before execution.

Scope

  • Replace only the invocation-local Annex B legacy candidate-name set with the existing exact-byte, lazy, failure-atomic secure membership helper.
  • Draw one secure seed when the first eligible candidate is inserted; strict code, candidate-free bodies, and skipped scans must request no entropy or table allocation.
  • Preserve the separate exact AST-node eligibility set, lexical shadowing, parameter/catch/destructuring rules, labeled/switch/try traversal, pre-created var bindings, duplicate-name behavior, source order, and OOM propagation.
  • Keep the existing lexical name traversal and its stack ownership unchanged.

No-workaround rules

  • No identifier/depth cap, source rewriting, blacklist, deterministic fallback seed, hash-only equality, skipped candidate/node, broadened rejection, or disabled Annex B behavior.
  • No stack implementation, queue, job, Promise, Worker, or Map/Set iterator changes.

Acceptance

  • Annex B candidate-name membership uses one non-default secure context per scan.
  • Strict/candidate-free/skipped paths remain lazy and allocate no candidate hash table or entropy.
  • Wide, escaped, duplicate, shadowed, labeled, switch, catch, and parameter cases preserve exact bindings/errors.
  • Focused normal and TSan tests pass without leaks or races.
  • Exact-parent relevant Annex B Test262 inventory has zero regressions.

Activity

  1. chrisbbreuer commented on Aug 25, 2026

    @chrisbbreuer
    MemberAuthor

    Landed on main in 52a7c387. Annex B legacy candidate names now use one lazy per-scan secure exact-byte context while the separate AST-node eligibility set and lexical NameStack traversal remain unchanged. Normal Annex B units pass 7/7; the focused TSan witness passes 1/1; exact-parent test/annexB/language remains 845 pass / 0 fail -> 845 / 0, with zero flips. Strict, candidate-free, and skipped paths install no candidate context/table.

  2. chrisbbreuer commented on Sep 1, 2026

    @chrisbbreuer
    MemberAuthor

    The deliberately separate Annex B node-identity follow-up is complete in #857 / fec38b3b. #760’s exact-name membership remains unchanged; eligible declaration nodes now use the shared lazy secure pointer-identity context. Exact-parent Annex B diagnostics remain byte-identical at 1086/1086.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions