Commit 130a873
committed
fix(rest): exempt a request from the ADR-0069 gate only when it carries a real path (#7432)
`isAuthGateAllowlisted(undefined)` returns `true` — it treats "no path" as
allow-listed. REST's `enforceAuth` passed `req.path` straight through, so a
request whose `path` was absent or an empty string read as allow-listed on
every route and the ADR-0069 gate (expired password / enforced MFA) did not
fire for a session policy says must be blocked.
`enforceAuth` now applies the guard the sibling seam already carries
(`shouldDenyAnonymous`, core/src/security/anonymous-deny.ts:122): a path
exempts a gated session only when it is a non-empty string the allow-list
actually accepts.
Nothing shipped was bypassable — the hono adapter populates `path` at all
three request-construction sites. What is fixed is the direction of the
default: the guard was carried by the caller's discipline on a fail-OPEN
seam, so a new transport adapter or any synthetic request disabled a
security gate by omission with no test going red.
Tests pin the consequence, not the guard expression: absent `path` and
empty-string `path` against a gated session are blocked (both go red with
the guard removed), while every allow-listed path shape still passes, an
ordinary gated request still blocks, an ungated pathless session is
untouched, and OPTIONS preflight stays exempt.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012J7U4wwUHYyZ7EgsUHuJA71 parent 31fb03d commit 130a873
3 files changed
Lines changed: 104 additions & 1 deletion
File tree
- .changeset
- packages/rest/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2432 | 2432 | | |
2433 | 2433 | | |
2434 | 2434 | | |
2435 | | - | |
| 2435 | + | |
| 2436 | + | |
| 2437 | + | |
| 2438 | + | |
| 2439 | + | |
| 2440 | + | |
| 2441 | + | |
| 2442 | + | |
| 2443 | + | |
| 2444 | + | |
| 2445 | + | |
| 2446 | + | |
| 2447 | + | |
2436 | 2448 | | |
2437 | 2449 | | |
2438 | 2450 | | |
| |||
0 commit comments