Skip to content

[Bug]: SECURITY.md overstates unconditional stripping of Authorization and Cookie #782

Closed

Description

@jimhoyd

Runtime revision and environment

URLCode v0.6.2 (a7d7ce1c4a540032cbc032ca0f605f1b3555b996), published npm core 0.6.2; macOS, Node v26.8.2. Read-only review on 2026-09-26; reproductions in disposable directories.

Minimal reproduction

Compare SECURITY.md's unconditional statement that a route's function/middleware "never receives" Cookie or Authorization with the shipped recipes/middleware authentication examples. Run urlcode test --project recipes/middleware: all 64 fixtures pass, including bearer/Basic requests whose route middleware reads Authorization and accepts the configured test credentials.

In packages/core/src/runtime.ts credentialHeaders is assembled from plugins and the extension registry. packages/core/src/extensions.ts adds cookie/authorization when processing activated extensions; an extension-free project has no such automatic registration. This explains the working recipe.

Expected: the security prose accurately scopes the credential projection to the implemented registration/extension behavior and distinguishes it from confinement of trusted Node code. Reconcile the examples and authoritative contract deliberately; do not blindly remove the recipe's access and break its documented behavior.

Relevant output

Published 0.6.2 recipe test result: {"total":64,"failed":0}. Source inspection confirms guestHeaders strips the assembled set, not unconditional hard-coded credential names. This is a documented-contract mismatch, not evidence of an authorization bypass in the auth extension.

Activity

  1. jimhoyd commented on Sep 26, 2026

    @jimhoyd
    CollaboratorAuthor

    Fixed in #786 (dfa5489), a docs-only change; GitHub didn't close this automatically.

    • SECURITY.md now says Cookie and Authorization are withheld from a route's own function or middleware only when an active extension or a plugin declares them. Each active extension withholds cookie and authorization plus the names it declares.
      • Without an extension or plugin, the headers pass through, which is what the middleware recipe relies on.
      • This projection is not confinement of trusted Node code.
    • Other pages were made consistent: EXTENSIONS.md, EGRESS.md and the RIM-EXT-CONTEXT-001 card.
    • Test: a new test in test/extension-context-header.test.ts pins both cases.
    • Behavior is unchanged.

    Generated by Claude Code

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