-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrecaptcha.mjs
More file actions
31 lines (30 loc) · 1.02 KB
/
Copy pathrecaptcha.mjs
File metadata and controls
31 lines (30 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { redact } from '../lib/redact.mjs';
export default {
id: 'recaptcha',
scope: 'request',
severity: 'blocking',
title: 'Google reCAPTCHA detected',
match(run) {
const hits = [];
for (const req of run.requests) {
const v = req.headers['g-recaptcha-response']
|| (req.postData && /g-recaptcha-response/.test(String(req.postData)) ? 'inline' : null);
if (v) {
hits.push({
request_id: req.id,
endpoint: `${req.method} ${req.path}`,
header: 'g-recaptcha-response',
header_value_redacted: v === 'inline' ? '(in form body)' : redact(v),
});
}
}
return hits;
},
explanation:
'Google reCAPTCHA generates a per-request token. v3 is score-based and ' +
'invisible; v2 requires user interaction. Both are bound to the browser session.',
recommendation:
"Run the replay inside the live browser via cdp('Runtime.evaluate'), " +
'or drive the UI to trigger the verification flow.',
execution_model: 'in_browser',
};