T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/fetch-book.mjs:18- Finding
Authenticated-browser scraping is not restricted to WeRead
- Content
View full analysis
{ await sleep(2500); const initial = await evalTarget(targetId, PAGE_EXTRACTOR); const contentBlocks = await collectContent(targetId, Number.isFinite(args.scrolls) ? args.scrolls : 6); const pageInfo = await infoTarget(targetId).catch(() => null); return { capturedAt: new Date().toISOString(), sourceUrl: args.bookUrl, page: { info: pageInfo, title: initial.title, url: initial.url, headings: initial.headings || [], }, ``` From `scripts/fetch-shelf.mjs`: ```js function parseArgs(argv) { const args = { url: DEFAULT_URL, output: DEFAULT_OUTPUT, keepOpen: false, debugDom: false }; for (let index = 0; index < argv.length; index += 1) { const token = argv[index]; if (token === "--url") args.url = argv[index + 1]; if (token === "--output") args.output = argv[index + 1]; if (token === "--keep-open") args.keepOpen = true; if (token === "--debug-dom") args.debugDom = true; } return args; } ``` ```js const data = await withNewTarget( args.url, async (targetId) => { ...[truncated 3198 chars]- Remediation
View remediation
