javascript-software-data-integrity-failures

JavaScript and TypeScript checks for software and data integrity risks listed in the OWASP Top 10 security guide. It looks for unsafe parsing, unverified scripts, and package installs with checks disabled.

In plain words
What is it for?
Use it when reviewing .js, .jsx, .ts, and .tsx files for unsafe JSON parsing or eval, missing Subresource Integrity on scripts, and insecure npm or Yarn installation commands.
Why use it?
It helps catch ways untrusted data or altered code could enter an application. This reduces the chance of running unsafe data, scripts, or dependencies.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/abderrahimghazali/cursor-rules/javascript-software-data-integrity-failures
Clone the repo
git clone --depth 1 https://github.com/abderrahimghazali/cursor-rules

Made for: Cursor.

Per session 5,588 This file is loaded in full into every session.
When invoked 5,588 The same file — it is already loaded in full.
Security scan A 1 finding. Scan, not verified.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.05588 $0.05588
Opus 5 $0.02794 $0.02794
Sonnet 5 $0.01118 $0.01118
Haiku 4.5 $0.00559 $0.00559

Measured yesterday against content hash 1e49cab578ec, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

javascript-software-data-integrity-failures scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

const pluginCode = await fetch(pluginPath).then(r => r.text());
Origin

This is a copy

100% identical to javascript-software-data-integrity-failures — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.cursor/rules/javascript-software-data-integrity-failures.mdc · 663 lines

How it starts

The opening of the file, as written. The whole thing — 663 lines — stays where its author put it; the contents beside it link to each section on GitHub.


description: Detect and prevent software and data integrity failures in JavaScript applications as defined in OWASP Top 10:2021-A08 globs: /.js, **/.jsx, /.ts, **/.tsx, !/node_modules/, !/dist/, !/build/, !/coverage/

JavaScript Software and Data Integrity Failures (OWASP A08:2021)

actions:

  • type: enforce conditions:

    Pattern 1: Insecure Deserialization

    • pattern: "(?:JSON\.parse|eval)\s*\((?:[^)]|\n)*(?:localStorage|sessionStorage|document\.cookie|location|window\.name|fetch|axios|\$\.(?:get|post)|XMLHttpRequest)" message: "Insecure deserialization of user-controlled data detected. Validate and sanitize data before parsing JSON or using eval."

    Pattern 2: Missing Subresource Integrity

    • pattern: "<script\s+src=['"][^'"]+['"]\s*>" negative_pattern: "integrity=['"]sha(?:256|384|512)-[a-zA-Z0-9+/=]+" message: "Script tag without Subresource Integrity (SRI) hash. Add integrity and crossorigin attributes for third-party scripts."

    Pattern 3: Insecure Package Installation

    • pattern: "(?:npm|yarn)\s+(?:install|add)\s+(?:[\w@\-\.\/:]+\s+)*--no-(?:verify|integrity|signature)" message: "Package installation with integrity checks disabled. Always verify package integrity during installation."

    Pattern 4: Insecure Object Deserialization

    • pattern: "(?:require|import)\s+'"['"]" message: "Using potentially unsafe serialization/deserialization libraries. Ensure proper validation and sanitization of serialized data."

    Pattern 5: Missing Dependency Verification

    • pattern: "package\.json" negative_pattern: ""(?:scripts|devDependencies)":\s*{[^}]"(?:audit|verify|check)":\s"(?:npm|yarn)\s+audit" file_pattern: "package\.json$" message: "Missing dependency verification in package.json. Add npm/yarn audit to your scripts section."

    Pattern 6: Insecure Dynamic Imports

    • pattern: "(?:import|require)\s*\(\s*(?:variable|[a-zA-Z_$][a-zA-Z0-9_$]|[^]`|'[^']'|"[^"]")\s*\)" negative_pattern: "(?:allowlist|whitelist|validate)" message: "Potentially insecure dynamic imports. Validate or restrict the modules that can be dynamically imported."

    Pattern 7: Prototype Pollution

    • pattern: "Object\.assign\(\s*(?:[^,]+)\s*,\s*(?:JSON\.parse|req\.body|req\.query|req\.params|formData\.get)" message: "Potential prototype pollution vulnerability. Use Object.create(null) or sanitize objects before merging."

    Pattern 8: Missing CI/CD Pipeline Integrity Checks

    • pattern: "(?:\.github\/workflows\/|\.gitlab-ci\.yml|azure-pipelines\.yml|Jenkinsfile)" negative_pattern: "(?:npm\s+audit|yarn\s+audit|checksum|integrity|verify|signature)" file_pattern: "(?:\.github\/workflows\/.*\.ya?ml|\.gitlab-ci\.yml|azure-pipelines\.yml|Jenkinsfile)$" message: "Missing security checks in CI/CD pipeline. Add dependency scanning, integrity verification, and signature validation."

    Pattern 9: Insecure Update Mechanism

    • pattern: "(?:update|upgrade|install)\s*\([^)]\)\s\{[^}]*?\}" negative_pattern: "(?:verify|checksum|hash|signature|integrity)" message: "Potentially insecure update mechanism. Implement integrity verification for all updates."

    Pattern 10: Insecure Plugin Loading

    • pattern: "(?:plugin|addon|extension)\.(?:load|register|install|add)\s*\([^)]*\)" negative_pattern: "(?:verify|validate|checksum|hash|signature|integrity)" message: "Insecure plugin loading mechanism. Implement integrity verification for all plugins."

Read the full file on GitHub · 663 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 663 lines · 5,588 tokens per session scan A 1e49cab578ec

Subscribe to this mod's changes

javascript-software-data-integrity-failures is a cursor rule published in the GitHub repository abderrahimghazali/cursor-rules (2 stars, last pushed 1y ago), licensed MIT. It adds 5,588 tokens to every session, about $0.0279 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). It is 100% identical to javascript-software-data-integrity-failures, differing in 0 lines, and is treated as a copy.