npfaerber

Node.js Security Audit

IT Ops & Securityv1.0.0
By npfaerberUpdated 2026-05-11nodejs-security-audit@clawhub_npfaerber/nodejs-security-audit
Security Scanning#Security Audit#Deployment

According to AlphaMoat, as of 2026-09, Node.js Security Audit has 1,847 downloads and 0 stars — ranked #4,543 of 5,078 AI skills overall, and #255 of 264 in IT Ops & Security.

Installs
334
Downloads
1.8K
Stars
-
Overall Rank
#4,543
Top 90% overall · Top 97% in IT Ops & Security
PlatformInstallsDownloadsStarsComments
ClawHub ↗451.7K--
SkillHub ↗3341.8K-—

Platforms count differently and update at different times.

What this skill does

Its checklist covers exposed secrets, injection, XSS, authentication, CORS, file paths, headers, rate limits, validation and dependencies. Findings use severity, file location and suggested fixes. Review commands and protect source and findings; the checklist and code snippets do not establish that an application is secure.

Profile published 2026-10-27

What you can do with it

  • Review a Node.js server before release

When to use it

  • When changed server code needs a focused security checklist

Example prompts

Generated from the skill’s documentation as examples; not results of actual runs.

Inspect this server and report evidence-backed findings with severity and file locations.

Monthly Trend

Downloads1.8K
6621.3K1.9K2026-03 · Downloads 7502026-05 · Downloads 1.1K2026-06 · Downloads 1.2K2026-07 · Downloads 1.4K2026-08 · Downloads 1.6K2026-09 · Downloads 1.8K26-0326-09
Stars-
0112026-03 · Stars -2026-05 · Stars -2026-06 · Stars -2026-07 · Stars -2026-08 · Stars -2026-09 · Stars -26-0326-09

The counting method changed in 2026-09: skills with the same name are now counted separately by author, and the full catalog is covered. Dashed lines show months before the change; they are not compared with later months, and no growth is computed across the change.

MonthDownloadsMoMStars
2026-091.8K—-
2026-081.6K+10.6%-
2026-071.4K+16.9%-
2026-061.2K+8.9%-
2026-051.1K—-
2026-03750—-

SKILL.md (original)

The author’s original file, shown as plain text without edits or review by AlphaMoat. Links are not clickable; check commands before running them. Fetched 2026-10-23.

2.9 KB · ClawHub v1.0.0
---
name: nodejs-security-audit
description: Audit Node.js HTTP servers and web apps for security vulnerabilities. Checks OWASP Top 10, CORS, auth bypass, XSS, path traversal, hardcoded secrets, missing headers, rate limiting, and input validation. Use when reviewing server code before deployment or after changes.
---

# Node.js Security Audit

Structured security audit for Node.js HTTP servers and web applications.

## Audit Checklist
Show all (96 lines)

### Critical (Must Fix Before Deploy)

**Hardcoded Secrets**
- Search for: API keys, passwords, tokens in source code
- Pattern: `grep -rn "password\|secret\|token\|apikey\|api_key" --include="*.js" --include="*.ts" | grep -v node_modules | grep -v "process.env\|\.env"`
- Fix: Move to env vars, fail if missing: `if (!process.env.SECRET) process.exit(1);`

**XSS in Dynamic Content**
- Search for: `innerHTML`, template literals injected into DOM, unsanitized user input in responses
- Fix: Use `textContent`, or escape: `str.replace(/[&<>"']/g, c => ({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":"&#39;"}[c]))`

**SQL/NoSQL Injection**
- Search for: String concatenation in queries, `eval()`, `Function()` with user input
- Fix: Parameterized queries, input validation

### High (Should Fix)

**CORS Misconfiguration**
- Search for: `Access-Control-Allow-Origin: *`
- Fix: Allowlist specific origins: `const origin = ALLOWED.has(req.headers.origin) ? req.headers.origin : ALLOWED.values().next().value`

**Auth Bypass**
- Check: Every route that should require auth actually checks it
- Common miss: Static file routes, agent/webhook endpoints, health checks that expose data

**Path Traversal**
- Check: `path.normalize()` + `startsWith(allowedDir)` on all file-serving routes
- Extra: Resolve symlinks with `fs.realpathSync()` and re-check

### Medium (Recommended)

**Security Headers**
```javascript
const HEADERS = {
  'X-Frame-Options': 'SAMEORIGIN',
  'X-Content-Type-Options': 'nosniff',
  'Referrer-Policy': 'strict-origin-when-cross-origin',
  'Permissions-Policy': 'camera=(), microphone=(), geolocation=()',
};
// Apply to all responses
```

**Rate Limiting**
```javascript
const attempts = new Map(); // ip -> { count, resetAt }
const LIMIT = 5, WINDOW = 60000;
function isLimited(ip) {
  const now = Date.now(), e = attempts.get(ip);
  if (!e || now > e.resetAt) { attempts.set(ip, {count:1, resetAt:now+WINDOW}); return false; }
  return ++e.count > LIMIT;
}
```

**Input Validation**
- Body size limits: `if (bodySize > 1048576) { req.destroy(); return; }`
- JSON parse in try/catch
- Type checking on expected fields

### Low (Consider)

**Dependency Audit:** `npm audit`
**Error Leakage:** Don't send stack traces to clients in production
**Cookie Security:** `HttpOnly; Secure; SameSite=Strict`

## Report Format

```
## Security Audit: [filename]

### Critical
1. **[Category]** Description — File:Line — Fix: ...

### High
...

### Medium
...

### Low
...

### Summary
X critical, X high, X medium, X low
```

Popular in IT Ops & Security

Data month: 2026-09 · Downloads, stars and installs are aggregated monthly from public skill registries (ClawHub, SkillHub). See methodology.