Skip to content
Back to skills

Source Code Patterns

ASecurity

This skill should be used when analyzing discovered source code for security issues. Helps identify dangerous functions, hardcoded secrets, and vulnerable packages.

  • 5 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 26, 2026
developmentjavascriptpythongojavaphpshellbashsqlnodeflask

Works with

  • api

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add allsmog/blackbox-claude-plugin --skill source-code-patterns --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Source Code Patterns?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Source Code Patterns
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/allsmog-source-code-patterns/badge)](https://www.skillsdirectory.com/skills/allsmog-source-code-patterns)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: Source Code Security Patterns
description: |
  This skill should be used when analyzing discovered source code for security issues.
  Helps identify dangerous functions, hardcoded secrets, and vulnerable packages.
version: 1.0.0
---

# Source Code Security Patterns

## Discovery Endpoints

Common backup/source locations to check:
- /download, /backup, /backup.zip
- /source.zip, /app.zip, /.git/
- *.bak, *.old files

## Dangerous Patterns by Language

### Python
| Pattern | Risk | Notes |
|---------|------|-------|
| js2py with user input | Critical | Check CVE-2024-28397 |
| yaml.load() no Loader | Critical | Use safe_load |
| subprocess shell=True | High | Command injection |
| render_template_string | High | SSTI |
| debug=True in Flask | Medium | Debugger access |
| Hardcoded secret_key | High | Session forgery |

### PHP
| Pattern | Risk | Notes |
|---------|------|-------|
| system/passthru/shell calls | Critical | Command injection |
| include with variable | Critical | LFI/RFI |
| unserialize user data | Critical | Object injection |

### Node.js
| Pattern | Risk | Notes |
|---------|------|-------|
| spawn/run with user input | High | Command injection |
| vm.runIn* functions | High | Sandbox escape |
| SQL string concatenation | High | SQL injection |

## Search for Secrets

```bash
# Passwords and keys
grep -rniE "(password|secret|token|api.?key)\s*[:=]" .

# Database URLs
grep -rniE "(mysql|postgres|mongo)://" .

# Private keys
grep -rnl "PRIVATE KEY" .

# Env files
find . -name ".env*"
```

## Vulnerable Package Versions

### Python (check requirements.txt)
- js2py <= 0.74: Sandbox escape CVE
- pyyaml < 5.4: Code execution
- flask < 2.0: Security fixes
- jinja2 < 2.11.3: Sandbox issues

### Node.js (check package.json)
- lodash < 4.17.21: Prototype pollution
- serialize-javascript < 3.1.0: RCE

## Quick Checklist

1. Check framework and version
2. Search for hardcoded secrets
3. Review package versions for CVEs
4. Find dangerous function calls
5. Look for debug mode enabled
6. Check for SQL string building
7. Find serialization with user input
8. Check template injection points

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.