client-js-audit

Audit client-side JavaScript for DOM XSS and token handling risks.

83|8|Updated May 6, 2026
One-click install
npx skills add https://github.com/Q16G/aster --skill client-js-audit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: client-js-audit
Source: https://github.com/Q16G/aster/tree/main/skills/code-audit/client-js-audit
Command: npx skills add https://github.com/Q16G/aster --skill client-js-audit

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Client-side JavaScript code frequently handles security-sensitive logic such as DOM updates, token storage, and cross-origin messaging, creating XSS and data-leak risks that are not fully covered by server-side scans.

Core Features & Use Cases

  • Source-to-sink analysis for DOM XSS vectors arising from client-controlled sources (location.hash, postMessage, etc.).
  • Token security guidance to identify unsafe storage patterns (localStorage, sessionStorage, insecure cookies) and leakage paths.
  • PostMessage security checks to enforce strict origin validation and safe data handling across windows/iframes.
  • Applicable to SPA front-ends, embedded widgets, and OAuth-like flows where client-side security is critical.

Quick Start

Run a client-side JavaScript security audit to identify DOM XSS risks, token handling flaws, and postMessage vulnerabilities.

Frequently Asked Questions about client-js-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit client-side JavaScript for DOM XSS vulnerabilities?

Audit client-side JavaScript for DOM XSS by tracing source-to-sink flows from client-controlled sources like location.hash and document.referrer to unsafe DOM update sinks. This process identifies injection vectors in SPA front-ends and embedded widgets, enabling targeted remediation.

What are common token security risks in SPA front-ends and OAuth-like flows?

Token security risks in SPA front-ends and OAuth-like flows involve unsafe storage patterns using localStorage or sessionStorage and insecure cookies. Identifying these leakage paths allows developers to implement safer token handling practices and prevent unauthorized data access.

How do I secure postMessage handlers for cross-origin iframe communication?

Secure postMessage handlers by enforcing strict origin validation and ensuring safe data handling across windows and iframes. This prevents unauthorized cross-origin messaging exploits and protects sensitive client-side data from malicious interference.

Can I use a client-side security audit for embedded widgets and OAuth flows?

Yes, you can apply a client-side security audit to embedded widgets and OAuth-like flows where client-side security is critical. The audit scope specifically covers these contexts to identify DOM XSS risks and token handling flaws unique to these architectures.

Why does server-side scanning miss DOM XSS and token leakage in front-end code?

Server-side scanning misses DOM XSS and token leakage because it cannot analyze client-controlled sources like location.hash or postMessage handlers. Client-side JavaScript executes in the browser, creating distinct XSS and data-leak risks requiring dedicated source-to-sink analysis.

What is the best way to find unsafe token storage patterns in JavaScript?

The best way to find unsafe token storage patterns in JavaScript is to audit client-side code for usage of localStorage, sessionStorage, and insecure cookies. This identifies potential leakage paths and provides actionable remediation guidance for secure token handling.