Repository navigation
test(js): pin the Chrome shape of a blob URL and its synchronous store - #782
Merged
Merged
Conversation
ntdatt812
force-pushed
the
fix/751-blob-object-url
branch
from
August 31, 2026 10:47
601194e to
979bbf0
Compare
The existing coverage asserts only the scheme --
URL.createObjectURL(new Blob(['hello'])).startsWith('blob:') -- which the
'blob:obscura/<base36>' form h4ckf0r0day#751 was filed about also satisfies, so it
cannot tell the fixed shape from the bug it replaced.
Pin the shape itself: blob:<document origin>/<v4 UUID>, unique per call,
naming no engine, with File accepted as a Blob and Chrome's two
TypeErrors verbatim for missing and non-Blob input.
Cover the two paths the fix has and the tests do not: the source is in
the store by the time createObjectURL returns, so a Worker built from the
URL in the same tick can read it, and revokeObjectURL removes it again.
ntdatt812
force-pushed
the
fix/751-blob-object-url
branch
from
September 6, 2026 15:20
979bbf0 to
f5b32ff
Compare
Contributor
|
right, the accepted half didn't pin the shape past the prefix — these two fill that cleanly. |
5 tasks done
whyparv
pushed a commit
to whyparv/obscura
that referenced
this pull request
Nov 17, 2026
…-url test(js): pin the Chrome shape of a blob URL and its synchronous store
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
This PR no longer changes behaviour.
mainalready mints Chrome-shaped blob URLs — @963s landed that in #804 (c9e4c9f) while this was open, and the production half of what I had here is redundant. Rebased onto it and narrowed to the two tests that fix landed without.Why
create_object_url_rejects_non_blob_input(SEC-503 / #820) covers the rejection half well, but the accepted half only asserts the scheme:The form #751 was filed about —
blob:obscura/<base36>— satisfies that too, so the assertion cannot tell the fixed shape from the bug. The shape is the whole point of #751: a page that reads a blob URL back (a Worker'sscriptURL, an anchor href,new URL(u).origin, a CSP report) saw the engine's name, and the base36 token failed every UUID parser.Two paths in the merged fix also have no coverage: the source is stored synchronously so a Worker constructed from the URL in the same tick can read it — the async
blob.text().then()store is what broke AWS WAF's proof-of-work worker — andrevokeObjectURLhas to remove the entry again.Testing
Run in a Linux container on rustc 1.98, against
main's implementation:To show the new tests earn their place rather than restating a green build, I reintroduced the exact bug —
const id = 'blob:obscura/' + Math.random().toString(36).slice(2);at the mint site — and re-ran the same three:That is the gap: the existing test stays green while the URL names the engine again.