Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2

updates:
- package-ecosystem: npm
directory: /csreview
schedule:
interval: weekly
day: monday
time: "06:00"
timezone: America/Sao_Paulo
groups:
npm-runtime:
patterns:
- "*"

- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
day: monday
time: "06:30"
timezone: America/Sao_Paulo
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on:
pull_request:
push:
branches:
- main

permissions:
contents: read

jobs:
test:
name: Node ${{ matrix.node-version }}
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
node-version:
- 20
- 24

defaults:
run:
working-directory: csreview

steps:
- name: Checkout
uses: actions/checkout@v5

- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: csreview/package-lock.json

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test

- name: Audit dependencies
run: npm audit --audit-level=low

- name: Verify package contents
run: npm pack --dry-run
43 changes: 43 additions & 0 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Semgrep

on:
pull_request:
push:
branches:
- main
schedule:
- cron: "47 3 * * 1"

permissions:
contents: read
security-events: write

jobs:
semgrep:
name: Semgrep SARIF
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- name: Checkout
uses: actions/checkout@v5

- name: Install Semgrep
run: python -m pip install --upgrade semgrep

- name: Run Semgrep
continue-on-error: true
run: |
semgrep scan \
--config auto \
--sarif \
--output semgrep.sarif \
--exclude node_modules \
--exclude csreview-reports \
.

- name: Upload Semgrep SARIF
uses: github/codeql-action/upload-sarif@v4
if: always() && hashFiles('semgrep.sarif') != ''
with:
sarif_file: semgrep.sarif
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Purpose & Utility

**CSReview** is a universal AI agent skill that performs **ultra-deep security audits** (automated pentest-style analysis) on codebases across multiple languages, frameworks, and platforms.
**CSReview** is a universal AI agent skill for development-time security alignment of the local workspace a developer is actively building. It applies a penetration tester's adversarial mindset to local source, configuration, dependencies, and infrastructure files (static SAST + SCA), but it does not perform live penetration testing against running, deployed, or production systems.

### CSReview is READ-ONLY

Expand All @@ -18,7 +18,14 @@ CSReview **NEVER modifies, deletes, or moves any files** in the analyzed project

The actual fixes are applied by the human developer or the coding agent, not by CSReview.

CSReview exists to slow down unsafe "vibe coding" before production: it inspects code, dependency manifests, framework configuration, database/BaaS rules, frontend/backend boundaries, and platform-specific surfaces, then writes a detailed report explaining what is exposed and why. It does not assume enough business or schema context to change the audited system itself.
CSReview exists to slow down unsafe "vibe coding" before release: it inspects local code, dependency manifests, framework configuration, database/BaaS rules, frontend/backend boundaries, and platform-specific surfaces, then writes a detailed report explaining what is exposed and why. It does not assume enough business or schema context to change the audited system itself.

### Scope

- **IN SCOPE**: the local development workspace/project, including local source code, configuration, `.env` files, infrastructure-as-code, and BaaS rule files. Local SAST/SCA tools such as Semgrep, npm audit, OSV-Scanner, and framework-native scanners may be run against that local code only.
- **GOAL**: improve the SECURITY and EFFICIENCY (cost/performance) of the project under development.
- **OUT OF SCOPE / PROHIBITED**: testing, probing, or calling live, deployed, or production systems; external service endpoints used by the app; DAST against running targets; modifying audited code; exfiltrating data.
- **Reference documentation research is ALLOWED**: reading OWASP, CWE, CVE/NVD, OSV, vendor advisories, and official framework documentation to ground remediation is allowed. That is reading documentation, not probing a target.

### Global Skill Installation Only

Expand Down Expand Up @@ -77,7 +84,7 @@ The verbal summary is not enough for implementation. A coding agent must analyze

Security vulnerabilities cost companies billions annually. Most development teams lack dedicated security engineers to review code before deployment. With the rise of **vibe coding** (non-technical users building software with AI agents), security risks have multiplied. CSReview bridges this gap by providing:

1. **Automated Pentest-Level Analysis**: Goes beyond basic linting - performs the same depth of analysis a human security consultant would do
1. **Development-Time Security Alignment**: Goes beyond basic linting with static source/config review, Semgrep/SCA evidence, and a security consultant's adversarial reasoning without probing live systems
2. **Dual Report System**:
- **HTML Report** in the user's language for human understanding
- **Markdown Report** in English for AI coding agents to parse and plan remediations without changing the audited code automatically
Expand All @@ -91,7 +98,7 @@ Security vulnerabilities cost companies billions annually. Most development team

### Real-World Use Cases

- **Pre-deployment security gate**: Run before pushing to production
- **Pre-release security gate**: Run before release while reviewing only the local workspace
- **Code review enhancement**: Augment human code reviews with automated security analysis
- **Legacy code audit**: Identify vulnerabilities in existing codebases
- **Compliance preparation**: Find issues before security audits (SOC 2, ISO 27001, LGPD/GDPR)
Expand Down Expand Up @@ -417,7 +424,7 @@ Simply ask your AI coding assistant:

### Pre-Deployment Review
```
@csreview Run a full security audit before production deployment
@csreview Run a full local workspace security review before release
```

### Backend Security
Expand Down
56 changes: 33 additions & 23 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,59 @@
# Security Policy

CSReview is a white-hat, development-time security tool. We take the security of
the tool itself — and of the reports it generates — seriously.
CSReview is a white-hat, development-time security alignment tool for local
workspaces. We take the security of the tool itself, its instructions, and the
reports it generates seriously.

## Supported Versions

Only the latest commit on the `main` branch is supported. Please update before
reporting an issue.

| Version | Supported |
| -------------------- | --------- |
| `main` (latest) | ✅ |
| older commits / forks| ❌ |
| Version | Supported |
| --------------------- | --------- |
| `main` (latest) | Yes |
| older commits / forks | No |

## Reporting a Vulnerability

**Please do not open public Issues or Pull Requests for security vulnerabilities.**
Do not open public Issues or Pull Requests for security vulnerabilities.

Report privately through GitHub's **Private Vulnerability Reporting**:
Report privately through GitHub's Private Vulnerability Reporting:

1. Open the [Security tab](https://github.com/decksoftware/csreview/security) of this repository.
2. Click **"Report a vulnerability"**.
3. Include the affected files/lines, the impact, and a reproduction if possible.
2. Click "Report a vulnerability".
3. Include the affected files/lines, impact, local reproduction steps, and relevant static evidence.

You can expect an initial acknowledgement within **5 business days**. Validated
Avoid including real secrets, tokens, private customer data, or exploit output.
Redact sensitive values before sharing evidence.

You can expect an initial acknowledgement within 5 business days. Validated
issues are fixed on `main` and credited, unless you prefer to remain anonymous.

## Scope

**In scope**
- The CSReview skill code (`csreview/src/**`) and the CLI.
- Security weaknesses in the **generated reports** — e.g., script injection into the
HTML report, or secret/credential leakage in the Markdown report.
- The skill instructions (`SKILL.md`) where they could steer a coding agent into
unsafe behavior.
In scope:

- The CSReview skill code (`csreview/src/**`) and CLI.
- Security weaknesses in generated reports, such as script injection into the
HTML report or credential leakage in the Markdown report.
- Skill instructions (`SKILL.md`) that could steer a coding agent into unsafe
behavior.
- Static-analysis behavior that violates the documented local-only, read-only
scope.

Out of scope:

**Out of scope**
- Findings that CSReview reports about *your own* audited code — that is the tool
- Findings that CSReview reports about your own audited code. That is the tool
working as intended, not a vulnerability in CSReview.
- Vulnerabilities in third-party scanners (Semgrep, OSV-Scanner, npm audit, etc.) —
please report those to their respective upstream projects.
- Social engineering, or anything requiring access to a maintainer's machine.
- Vulnerabilities in third-party scanners such as Semgrep, OSV-Scanner, npm
audit, CodeQL, or similar tools. Report those to their upstream projects.
- Social engineering or anything requiring access to a maintainer's machine.
- Testing, probing, or calling live systems, production services, external
application endpoints, or user data while reporting an issue here.

## Our Commitment

CSReview is **read-only** on audited code and never tests live, deployed, or
CSReview is read-only on audited code and never tests live, deployed, or
production systems. If you find a way it violates that guarantee, treat it as a
high-priority report.
23 changes: 16 additions & 7 deletions csreview/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ description: "Ultra-deep security audit and pentest analysis for codebases. Gene

## Overview

This skill performs ultra-deep security analysis (automated pentest-style analysis) on codebases across multiple languages, frameworks, and platforms. It identifies vulnerabilities, data leakage risks, misconfigurations, and security flaws, then generates:
This skill performs development-time security alignment for the local workspace a developer is actively building. It applies a penetration tester's adversarial mindset to the project's local source, configuration, dependencies, and infrastructure files (static SAST + SCA). It does NOT perform live penetration testing against running, deployed, or production systems. It identifies vulnerabilities, data leakage risks, misconfigurations, and security flaws, then generates:

## Scope

- **IN SCOPE**: the local development workspace/project, including all local source code, configuration, `.env` files, infrastructure-as-code, and BaaS rule files. Local SAST/SCA tools such as Semgrep, npm audit, OSV-Scanner, and framework-native scanners may be run against that local code only.
- **GOAL**: improve the SECURITY and EFFICIENCY (cost/performance) of the project under development.
- **OUT OF SCOPE / PROHIBITED**: testing, probing, or calling live, deployed, or production systems; external service endpoints used by the app; DAST against running targets; modifying audited code; exfiltrating data.
- **Reference documentation research is ALLOWED**: reading OWASP, CWE, CVE/NVD, OSV, vendor advisories, and official framework documentation to ground remediation is allowed. That is reading documentation, not probing a target.

1. **HTML Report** (`csreview-reports/<agent>_security-report.html`) - Visual report for human review with executive summary, charts, and detailed findings
2. **Markdown Report** (`csreview-reports/<agent>_security-findings.md`) - Structured report for humans and coding agents to understand, prioritize, and plan remediations without CSReview modifying the audited code
Expand Down Expand Up @@ -51,7 +58,7 @@ CSReview includes built-in **Code Review** capabilities (equivalent to codex:rev
- User asks for vulnerability scan or pentest analysis
- User wants to check for data leakage or exposed secrets
- User mentions SQL injection, XSS, auth flaws, or security concerns
- Before production deployment for security validation
- Before release or deployment preparation, while reviewing only the local workspace
- User asks to review Supabase, Firebase, Appwrite, Neon, or similar backend security
- User invokes `@csreview` or mentions CSReview
- User wants compliance verification (LGPD, GDPR, SOC 2, HIPAA)
Expand Down Expand Up @@ -1214,8 +1221,8 @@ For each vulnerability found:
│ Vulnerable Code: │
│ [syntax-highlighted code snippet] │
│ │
│ Exploitation Scenario:
Step-by-step how an attacker could exploit
Potential Exploitation Path (theoretical, unverified):
Static-analysis hypothesis; not a validated or executed exploit.
│ │
│ Impact: │
│ What could happen if exploited │
Expand Down Expand Up @@ -1299,8 +1306,8 @@ For each vulnerability found:
<p>...</p>
<h3>Vulnerable Code</h3>
<pre><code class="language-typescript">...</code></pre>
<h3>Exploitation Scenario</h3>
<p>...</p>
<h3>Potential Exploitation Path (theoretical, unverified)</h3>
<p>Static-analysis hypothesis only; not a validated or executed exploit.</p>
<h3>Impact</h3>
<p>...</p>
<h3>Recommended Fix</h3>
Expand Down Expand Up @@ -1419,7 +1426,9 @@ const query = `SELECT * FROM users WHERE email = '${email}' AND password = '${pa
const result = await db.query(query);
```

#### Exploitation Scenario
#### Potential Exploitation Path (theoretical, unverified)
This is a hypothesis derived from static analysis, not a validated or executed exploit.

1. Attacker submits email: `' OR '1'='1`
2. Query becomes: `SELECT * FROM users WHERE email = '' OR '1'='1' AND password = 'anything'`
3. Authentication bypass achieved
Expand Down
6 changes: 3 additions & 3 deletions csreview/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions csreview/package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"name": "csreview",
"version": "1.0.0",
"version": "0.0.1",
"description": "Ultra-deep security audit and pentest analysis for codebases",
"main": "src/index.js",
"bin": {
"csreview": "./src/cli.js"
},
"type": "module",
"engines": {
"node": "20 || >=22"
"node": ">=18"
},
"scripts": {
"test": "node --test \"test/**/*.test.js\"",
"test": "node --test test/analysis.test.js",
"doctor": "node src/cli.js --doctor"
},
"keywords": ["security", "audit", "pentest", "code-review"],
"author": "",
"author": "decksoftware",
"license": "MIT",
"files": [
"src/",
Expand Down
Loading