Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

sauravpanda/browserai
main @ 7da5f50
3
Fixes
0
CVEs
HIGH
Peak severity
66.7%
Coverage
Highlights
Denial of Service: 2 prior fixes. Scrutinize any change in this area.
src/core/agent/browser-agent.ts: most-fixed (1 issue). Treat as high-risk during review.
2 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

DOM-Based XSS: The application used unsafe string interpolation inside document.querySelector during selector generation. An attacker who controls element identifiers could craft malicious inputs to manipulate the DOM query or trigger unexpected behaviors, which was mitigated by iterating DOM elements and validating URL protocols.
Denial of Service: A lack of proper base cases in recursive operations inside the content identifier's semantic relationship checker allowed execution to fall into infinite loops. This caused guaranteed stack overflow crashes when parsing complex or cyclic DOM structures.
Denial of Service: The model auto-loading mechanism lacked concurrency locks, exposing it to race conditions. Triggering multiple concurrent model load requests simultaneously would exhaust resources and degrade application availability, which was resolved by implementing a promise-based concurrency lock.