Skip to content

Commit 39dae6f

Browse files
teromenetrflynn89
authored andcommitted
LibWeb: Fix SRI handling of badly-formatted strings
1 parent 0da7441 commit 39dae6f

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

Libraries/LibWeb/SRI/SRI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ ErrorOr<Vector<Metadata>> parse_metadata(StringView metadata)
9090
auto algorithm = hash_expr_token_list[0];
9191

9292
// 6. If hash-expr-token-list[1] exists, set base64-value to hash-expr-token-list[1].
93-
if (hash_expr_token_list.size() >= 1)
93+
if (hash_expr_token_list.size() > 1)
9494
base64_value = hash_expr_token_list[1];
9595

9696
// 7. If algorithm is not a hash function recognized by the user agent, continue.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.body {}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
6+
<link
7+
href="invalid-integrity-attribute.css"
8+
type="text/css"
9+
rel="stylesheet"
10+
crossorigin="anonymous"
11+
integrity="051df3b15e50dd8711b1fa2f4e11f69060b4d77e0a3950a5ae2dc9f5c6bf8a37"
12+
nonce=""
13+
>
14+
<title>Test</title>
15+
</head>
16+
<body>

0 commit comments

Comments
 (0)