Skip to content

Normalize paths before payment access-control checks - #31

Open
jillesme wants to merge 1 commit into
mainfrom
fix/path-normalization-bypass
Open

Normalize paths before payment access-control checks#31
jillesme wants to merge 1 commit into
mainfrom
fix/path-normalization-bypass

Conversation

@jillesme

Copy link
Copy Markdown
Collaborator

Summary

  • canonicalize request paths before protected-route matching
  • use the same canonical URL when forwarding requests to the origin
  • match protected patterns case-insensitively to safely cover case-insensitive origins
  • reject malformed, control-character, and nested encodings instead of passing ambiguous paths through
  • add regression tests for duplicate slashes, encoded separators, casing, dot segments, backslashes, and the built-in protected endpoint

This prevents the payment/access-control decision from being made against a different path representation than the one interpreted by the origin.

Behavior change

Ambiguous paths with malformed or nested percent-encoding now return 400 Invalid request path rather than being proxied.

Testing

  • npm test
  • npm run lint
@jillesme
jillesme marked this pull request as ready for review August 14, 2026 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant