javascript-security-logging-monitoring-failures

A set of JavaScript security checks based on OWASP A09, a recognised category covering missing security logging and monitoring.

In plain words
What is it for?
It checks error handling, log statements, authentication attempts, authorization checks, and sensitive data such as passwords, tokens, and session details.
Why use it?
It flags code that may hide security events, expose sensitive information in logs, or fail to record authentication and permission decisions.

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/ivangrynenko/cursorrules/javascript-security-logging-monitoring-failures
Clone the repo
git clone --depth 1 https://github.com/ivangrynenko/cursorrules

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 6,053 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found 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.00000 $0.06053
Opus 5 $0.00000 $0.03027
Sonnet 5 $0.00000 $0.01211
Haiku 4.5 $0.00000 $0.00605

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

Security

Grade A, and why

javascript-security-logging-monitoring-failures scanned grade A with 0 findings 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.cursor/rules/javascript-security-logging-monitoring-failures.mdc · 802 lines

How it starts

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

JavaScript Security Logging and Monitoring Failures (OWASP A09:2021)

actions:

  • type: enforce conditions:

    Pattern 1: Missing Error Logging

    • pattern: "(?:try\s*{[^}]}\scatch\s*\([^)]\)\s{[^}]})(?![^;{](?:console\.(?:error|warn|log)|logger?\.(?:error|warn|log)|captureException))" message: "Error caught without proper logging. Implement structured error logging for security events."

    Pattern 2: Sensitive Data in Logs

    • pattern: "console\.(?:log|warn|error|info|debug)\s*\([^)](?:password|token|secret|key|credential|auth|jwt|session|cookie)" negative_pattern: "\\\|redact|mask|sanitize" message: "Potential sensitive data in logs. Ensure sensitive information is redacted before logging."

    Pattern 3: Missing Authentication Logging

    • pattern: "(?:login|signin|authenticate|auth)\s*\([^)]\)\s{[^}]}" negative_pattern: "(?:log|audit|record|track)\s\(" message: "Authentication function without logging. Log authentication attempts, successes, and failures."

    Pattern 4: Missing Authorization Logging

    • pattern: "(?:authorize|checkPermission|hasAccess|isAuthorized|can)\s*\([^)]\)\s{[^}]}" negative_pattern: "(?:log|audit|record|track)\s\(" message: "Authorization check without logging. Log access control decisions, especially denials."

    Pattern 5: Insufficient Error Detail

    • pattern: "(?:console\.error|logger?\.error)\s*\([^)](?:error|err|exception)\s\)" negative_pattern: "(?:error\.(?:message|stack|code|name)|JSON\.stringify\(error\)|serialize)" message: "Error logging with insufficient detail. Include error type, message, stack trace, and context."

    Pattern 6: Missing Security Event Logging

    • pattern: "(?:bruteForce|rateLimit|block|blacklist|suspicious|anomaly|threat|attack|intrusion|malicious)" negative_pattern: "(?:log|audit|record|track|monitor|alert|notify)" message: "Security event detection without logging. Implement logging for all security-relevant events."

    Pattern 7: Inconsistent Log Formats

    • pattern: "console\.(?:log|warn|error|info|debug)\s*\(" negative_pattern: "JSON\.stringify|structured|format" message: "Inconsistent log format. Use structured logging with consistent formats for easier analysis."

    Pattern 8: Missing Log Correlation ID

    • pattern: "(?:api|http|fetch|axios|request)\s*\([^)]*\)" negative_pattern: "(?:correlationId|requestId|traceId|spanId|context)" message: "API request without correlation ID. Include correlation IDs in logs for request tracing."

    Pattern 9: Missing High-Value Transaction Logging

    • pattern: "(?:payment|transaction|order|purchase|transfer|withdraw|deposit)\s*\([^)]*\)" negative_pattern: "(?:log|audit|record|track)" message: "High-value transaction without audit logging. Implement comprehensive logging for all transactions."

    Pattern 10: Client-Side Logging Issues

    • pattern: "(?:window\.onerror|window\.addEventListener\s*\(\s*['"]error['"])" negative_pattern: "(?:send|report|log|capture|track)" message: "Client-side error handler without reporting. Implement error reporting to backend services."

    Pattern 11: Missing Log Levels

    • pattern: "console\.log\s*\(" negative_pattern: "logger?\.(?:error|warn|info|debug|trace)" message: "Using console.log without proper log levels. Implement a logging library with appropriate log levels."

    Pattern 12: Missing Monitoring Integration

    • pattern: "package\.json" negative_pattern: "(?:sentry|newrelic|datadog|appinsights|loggly|splunk|elasticsearch|winston|bunyan|pino|loglevel)" file_pattern: "package\.json$" message: "No logging or monitoring dependencies detected. Consider adding a proper logging library and monitoring integration."

Read the full file on GitHub · 802 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 · 802 lines · 6,053 tokens per session scan A 0ff60ffa6eb7

Subscribe to this mod's changes

javascript-security-logging-monitoring-failures is a cursor rule published in the GitHub repository ivangrynenko/cursorrules (87 stars, last pushed 10mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 6,053 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.