You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0a534b5
Browse filesBrowse the repository at this point in the historyBrowse files
fix(api): refuse a wildcard mixed with a tag, and bound every echoed segment
All four findings verified against the code; all four were real.
`If-Match: *, "7"` was answered `AnyExisting`. RFC 9110 § 13.1.1 makes the
wildcard an alternative to the tag list — `If-Match = "*" / #entity-tag` — not a
member of it, so a mixed list is a malformed precondition. Measured:
Microsoft's `TryParseStrictList` accepts it as a two-element list, and the loop
returned on the first `*` it saw, in either order. The result was the *weaker*
reading of a header the API could not understand — "any version, as long as it
exists" answered to a client that had also named one — which is the exact
failure this type refuses one paragraph above, wearing a different shape. Four
cases cover both orderings through both entry points; all four go red against
the old branch.
`SortSpecification` bounded the value it quotes back on the term-count path and
not on the per-segment one, so a `sort` with no commas — which never reaches
that guard — arrived whole. An 8 KB single field was echoed into a Problem
Details body and every log line carrying one. Both paths go through one
`Bounded` helper now.
Two more holes in my own scanner, both in the same method the last round
touched. `CopyLiteral` treated a raw string literal's first quote as its
terminator, so `"""…"""` put the scanner back into code while it was still
inside a string — and a `//` there swallowed the rest of the line again, which
is the bug the literal tracking was added to fix. It records the opening quote
run and closes only on a run of the same length. A probe carrying a raw literal
with a quote, a `//` and a banned literal now fails the rule, and so does a
`Request.Host` on the line after it — which is what proves the scanner exits the
literal rather than staying in it.
And the frontend architecture document showed the middleware setting
`x-learnstack-host` under a comment claiming it was "what the SDK states to the
API", conflating the inward carry with the outward statement and never showing
the hop secret at all. They are now two things: the middleware carries the host
inward, and the SDK pairs it with the secret from server configuration on the
way out — with the reason the secret is not in the middleware said outright,
which is that a secret written into a forwarded request header travels further
than the one hop it authenticates.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments