agentleFS
zahidoverflowzahidoverflow/viperclaw/skills/viper-browseros-agent/SKILL.md

viper-browseros-agent

Skill22 starsChanged 15 days agoMITView on GitHub

BrowserOS Neo Live Application Inspection & DOM Security Audit Skill. Uses BrowserOS MCP tabs to inspect client storage, cookie flags, CSP headers, and SPA runtime behavior.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run the following discovery commands across the target repository before manual code review:

    line 30
  2. Distinctive:

    Verify whether an upstream API Gateway, global middleware, or ORM hook already enforces the control before flagging a controller.

    line 61
  3. Distinctive:

    Write a Positive Unit Test confirming authorized, schema-valid requests succeed.

    line 85
  4. Distinctive:

    Write a Negative Security Regression Test confirming unauthorized, cross-tenant, or malformed inputs are deterministically rejected.

    line 86

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

BrowserOS Neo Live Application, Storage & DOM Security Auditor (viper-browseros-agent)

1. Executive Scope, Standards & CWE/OWASP Mapping

  • Frameworks & Standards: OWASP WSTG-CLNT (Client-Side Testing), OWASP ASVS V3/V14, W3C CSP Level 3
  • Primary CWE Mapping: CWE-922 (Insecure Storage of Sensitive Information in localStorage), CWE-79 (DOM XSS), CWE-614 (Missing Secure Cookie Flag)
  • ViperClaw MCP Tools: viper_browser_ingest, viper_harvest_js, viper_jwt_audit, viper_verify_and_report
  • ViperClaw CLI Command: viperclaw browser --scripts && viperclaw browser --ingest snapshot.json --db .viperclaw/graph.db

2. Threat Model & Root-Cause Architecture

flowchart LR
  Tab["Live BrowserOS Tab (Signed-In SPA)"] --> Hook["evaluate_in_page (Storage & Fetch Telemetry)"] --> Ingest["viper_browser_ingest (BrowserBridge)"] --> Graph[("SQLite Assessment Graph & JWT/JS Audit")]

Root-Cause Analysis

Static bundle inspection misses dynamically fetched configurations, runtime localStorage/sessionStorage token leaks, fetch/XHR headers computed at runtime, and DOM state transitions that only occur inside an authenticated browser session.


3. Deterministic Discovery & Grep/AST Audit Commands

Run the following discovery commands across the target repository before manual code review:

# 1. Automated ViperClaw analysis
viperclaw browser --scripts && viperclaw browser --ingest snapshot.json --db .viperclaw/graph.db

# 2. Rapid static pattern discovery (ripgrep)
viperclaw browser --scripts
viperclaw browser --ingest snapshot.json --db .viperclaw/graph.db

4. Senior Security Engineer 8-Point Audit Checklist

Control IDAudit Verification TargetPass CriteriaFail / Vulnerability Indicator
BROS-01Client Storage Credential Auditwindow.localStorage and window.sessionStorage contain zero raw JWTs, refresh tokens, or PII.Long-lived Bearer JWTs or API keys persisted in localStorage (accessible to any XSS).
BROS-02Runtime fetch / XHR Endpoint MappingAll background API calls captured via install_runtime_hooks enforce server-side authentication and tenant scoping.Hidden /api/internal/* or GraphQL mutations invoked by UI components lack backend role checks.
BROS-03Next.js __NEXT_DATA__ / Nuxt State AuditHydration state (window.__NEXT_DATA__, window.__NUXT__) contains only fields rendered in the UI.Full database user/organization objects (including internal IDs, emails, or role flags) serialized into page HTML.
BROS-04Live Cookie Attribute VerificationCookies visible in document.cookie exclude session identifiers (HttpOnly properly hides session cookies from JS).Primary authentication session cookie readable via document.cookie.
BROS-05DOM Sink & Client Router InspectionURL query/hash changes (?redirect=, #tab=) do not trigger unescaped DOM writes or open redirects.Client router passes URL parameters directly into innerHTML or window.location.href.
BROS-06CORS & Preflight Runtime BehaviorCross-origin API requests use explicit origin allowlists rather than reflecting the browser's Origin header.API responds with Access-Control-Allow-Origin: <arbitrary-origin> + Allow-Credentials: true.
BROS-07Post-Logout Browser State CleanupClicking Logout clears localStorage, sessionStorage, IndexedDB caches, and invalidates the server session.Sensitive tenant data remains in localStorage or browser back-button cache after logout.
BROS-08Visual & Telemetry Evidence CaptureAudit findings include both viper_browser_ingest JSON receipts and browseros-neo:screenshot visual confirmation.Client-side issues reported without runtime DOM confirmation.

5. False-Positive Elimination & CVSS v3.1 Triage Rubric

False-Positive Gate

  1. Verify whether an upstream API Gateway, global middleware, or ORM hook already enforces the control before flagging a controller.
  2. Confirm the code path is reachable from an external entrypoint (not dead code, CLI-only admin script, or unit-test fixture).
Severity TierBaseline CVSS v3.1 VectorQualifying Security Impact
HIGH (8.1)CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:NHydration state (__NEXT_DATA__) or background XHR leaks cross-tenant tokens or administrative APIs.
MEDIUM (6.1)CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:NVerified DOM XSS or open redirect triggered in live browser session.
LOW (3.7)CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:N/A:NSensitive session token stored in localStorage instead of HttpOnly cookie.

6. Production Remediation Patterns (Vulnerable vs. Hardened Code)

# 1. Retrieve BrowserOS runtime telemetry scripts (extract_auth_and_state & install_runtime_hooks)
viperclaw browser --scripts

# 2. After running extract_auth_and_state in BrowserOS evaluate_in_page, ingest snapshot into ViperClaw
viperclaw browser --ingest ./browser_snapshot.json --db .viperclaw/graph.db

7. Regression Testing & Continuous Verification

  1. Write a Positive Unit Test confirming authorized, schema-valid requests succeed.
  2. Write a Negative Security Regression Test confirming unauthorized, cross-tenant, or malformed inputs are deterministically rejected.
  3. Re-run viperclaw taint and viperclaw verify to confirm zero remaining unmitigated flows in .viperclaw/graph.db.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.