MCPcopy
hub / github.com/vercel/next.js / checkInjected

Function checkInjected

test/production/pages-dir/production/test/security.ts:12–21  ·  view source on GitHub ↗
(browser)

Source from the content-addressed store, hash-verified

10
11// Does the same evaluation checking for INJECTED for 5 seconds after hydration, triggering every 500ms
12async function checkInjected(browser) {
13 const start = Date.now()
14 while (Date.now() - start < 5000) {
15 const bodyText = await getBrowserBodyText(browser)
16 if (/INJECTED/.test(bodyText)) {
17 throw new Error('Vulnerable to XSS attacks')
18 }
19 await waitFor(500)
20 }
21}
22
23export default (next: NextInstance) => {
24 describe('With Security Related Issues', () => {

Callers 1

security.tsFile · 0.85

Calls 4

getBrowserBodyTextFunction · 0.90
waitForFunction · 0.90
testMethod · 0.65
nowMethod · 0.45

Tested by

no test coverage detected