SRI interprets certain invalid integrity attributes as having incorrect hash
Categories
(Core :: DOM: Security, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox149 | --- | fixed |
People
(Reporter: jrmuizel, Assigned: maltejur)
References
(Blocks 1 open bug, )
Details
(Keywords: webcompat:platform-bug)
User Story
user-impact-score:200
Attachments
(2 files, 1 external file, 1 obsolete file)
This is a reduced version of bug 2003813.
It seems like Chrome and Safari will not block css loads with integrity if the integrity field is malformed.
| Reporter | ||
Comment 1•10 months ago
|
||
| Reporter | ||
Comment 2•10 months ago
|
||
| Reporter | ||
Comment 3•10 months ago
|
||
Updated•10 months ago
|
Updated•10 months ago
|
| Assignee | ||
Updated•10 months ago
|
| Assignee | ||
Comment 4•10 months ago
|
||
It looks like this was already raised in the WPT interop repo some time ago, and the SRI WPT has already been expanded to test this.
To quote from https://github.com/web-platform-tests/interop/issues/666#issue-2325261451:
<head>
<link rel="stylesheet" href="demo.css" >
</head>It's loading normally.
<head>
<link rel="stylesheet" href="demo.css" integrity="..." crossorigin="anonymous">
</head>The ressource will be allowed in Chrome, FF and Safari.
<head>
<link rel="stylesheet" href="demo.css" integrity="sha256-AAA" crossorigin="anonymous">
</head>The ressource will be blocked in all thre browers.
<head>
<link rel="stylesheet" href="demo.css" integrity="sha256-..." crossorigin="anonymous">
</head>The ressource will be allowed in Chrome and Safari but blocked in FF.
And from https://github.com/web-platform-tests/interop/issues/666#issuecomment-2675072474:
I think the spec for this is https://w3c.github.io/webappsec-subresource-integrity/#the-integrity-attribute and that the problem with the
integrity="sha256-..."must be that Firefox treats "..." as an invalid or mismatching SHA-256 hash, instead of rejecting the whole "sha256-..." string as not matching the ABNF grammar in the spec.In other words, I think Firefox isn't following the spec here. I couldn't find any tests for this, so I sent web-platform-tests/wpt#50875 using your example.
| Assignee | ||
Comment 5•10 months ago
|
||
Comment 8•10 months ago
|
||
Backed out for causing mochitest failures @test_bug_1364262.html.
Comment 10•10 months ago
|
||
Comment 11•10 months ago
|
||
Backed out for causing wpt failures on preload/modulepreload.html
| Assignee | ||
Updated•10 months ago
|
Comment 12•9 months ago
|
||
The severity field is not set for this bug.
:freddy, could you have a look please?
For more information, please visit BugBot documentation.
Updated•9 months ago
|
Updated•9 months ago
|
Comment 13•9 months ago
|
||
Comment 15•9 months ago
|
||
| bugherder | ||
Updated•8 months ago
|
Description
•