T09 · Insecure Skill Coding Practices
- Location
scripts/download_book.py:211- Finding
Unvalidated file-host URLs can cause credential disclosure to attacker-controlled sites
- Content
View full analysis
Optional[dict]: _owns_browser = browser is None if _owns_browser: p = await async_playwright().start() browser = await p.chromium.launch(headless=headless) page = await browser.new_page() try: print(f"Decrypting file host link...") await page.goto(file_url, wait_until='domcontentloaded', timeout=30000) await asyncio.sleep(3) body_text = await (await page.query_selector('body')).inner_text() if '输入文件' in body_text or '访问密码' in body_text or '解密' in body_text: input_box = await page.query_selector( 'input[type="text"], input[type="password"], input.layui-input' ) if input_box and password: await input_box.type(password, delay=50) btn = await page.query_selector( 'button:has-text("解密"), ' 'input[type="submit"][value*="解密"], .layui-btn' ) if not btn: btn = await page.query_selector('button, input[type="submit"]') if btn: await btn.click() print(f" Entered password: {password}") await asyncio.sleep(5) ``` The secondary-source implemen ...[truncated 3802 chars]- Remediation
View remediation
