T09 · Insecure Skill Coding Practices
- Location
scripts/web_search.py:33- Finding
Untrusted Search Result Pages Are Loaded in an Unsandboxed Browser
- Content
View full analysis
{ document.querySelectorAll('script,style,nav,header,footer,.ad,.ads,[class*="banner"],[id*="banner"],.sidebar,.comment,.popup,.modal,.cookie').forEach(e=>e.remove()); for (const sel of ['article','main','.content','.post','.article','#content','#main','.entry-content','.post-content','[itemprop="articleBody"]']) { const m = document.querySelector(sel); if (m && m.innerText.length > 200) return m.innerText; } return document.body ? document.body.innerText : ''; }""") except Exception as e: print(f"[fetch] 失败: {e}", file=sys.stderr) finally: try: ctx.close() except Exception: pass result = (text or "").strip()[:8000] print(f"[fetch] {len(result)}字 | {time.time() - start:.1f}s", file=sys.stderr) return result or "抓取失败" ``` ```python if full > 0 and results: for i in range(min(f ...[truncated 3101 chars]- Remediation
View remediation
