create-agentic-app 1.1.56 → 1.1.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template/.agents/skills/security-scanner/SKILL.md +157 -0
- package/template/.agents/skills/security-scanner/references/A01-broken-access-control.md +136 -0
- package/template/.agents/skills/security-scanner/references/A02-security-misconfiguration.md +130 -0
- package/template/.agents/skills/security-scanner/references/A03-software-supply-chain-failures.md +117 -0
- package/template/.agents/skills/security-scanner/references/A04-cryptographic-failures.md +141 -0
- package/template/.agents/skills/security-scanner/references/A05-injection.md +155 -0
- package/template/.agents/skills/security-scanner/references/A06-insecure-design.md +145 -0
- package/template/.agents/skills/security-scanner/references/A07-authentication-failures.md +150 -0
- package/template/.agents/skills/security-scanner/references/A08-software-data-integrity-failures.md +132 -0
- package/template/.agents/skills/security-scanner/references/A09-security-logging-alerting-failures.md +130 -0
- package/template/.agents/skills/security-scanner/references/A10-mishandling-exceptional-conditions.md +154 -0
- package/template/.agents/skills/security-scanner/references/report-template.md +148 -0
- package/template/.claude/agents/security-scanner.md +214 -0
- package/template/.claude/skills/security-scanner/SKILL.md +157 -0
- package/template/.claude/skills/security-scanner/references/A01-broken-access-control.md +136 -0
- package/template/.claude/skills/security-scanner/references/A02-security-misconfiguration.md +130 -0
- package/template/.claude/skills/security-scanner/references/A03-software-supply-chain-failures.md +117 -0
- package/template/.claude/skills/security-scanner/references/A04-cryptographic-failures.md +141 -0
- package/template/.claude/skills/security-scanner/references/A05-injection.md +155 -0
- package/template/.claude/skills/security-scanner/references/A06-insecure-design.md +145 -0
- package/template/.claude/skills/security-scanner/references/A07-authentication-failures.md +150 -0
- package/template/.claude/skills/security-scanner/references/A08-software-data-integrity-failures.md +132 -0
- package/template/.claude/skills/security-scanner/references/A09-security-logging-alerting-failures.md +130 -0
- package/template/.claude/skills/security-scanner/references/A10-mishandling-exceptional-conditions.md +154 -0
- package/template/.claude/skills/security-scanner/references/report-template.md +148 -0
- package/template/next-env.d.ts +1 -1
- package/template/specs/ui-polish-responsive/README.md +59 -0
- package/template/specs/ui-polish-responsive/action-required.md +3 -0
- package/template/specs/ui-polish-responsive/requirements.md +53 -0
- package/template/specs/ui-polish-responsive/tasks/task-01-globals-css.md +144 -0
- package/template/specs/ui-polish-responsive/tasks/task-02-layout.md +66 -0
- package/template/specs/ui-polish-responsive/tasks/task-03-site-header.md +79 -0
- package/template/specs/ui-polish-responsive/tasks/task-04-site-footer.md +63 -0
- package/template/specs/ui-polish-responsive/tasks/task-05-home-page.md +215 -0
- package/template/specs/ui-polish-responsive/tasks/task-06-dashboard.md +222 -0
- package/template/specs/ui-polish-responsive/tasks/task-07-chat-page.md +225 -0
- package/template/specs/ui-polish-responsive/tasks/task-08-profile-page.md +192 -0
- package/template/specs/ui-polish-responsive/tasks/task-09-auth-pages.md +97 -0
- package/template/specs/ui-polish-responsive/tasks/task-10-setup-checklist.md +120 -0
- package/template/specs/ui-polish-responsive/tasks/task-11-starter-prompt-modal.md +87 -0
- package/template/src/app/globals.css +65 -7
- package/template/src/app/layout.tsx +2 -2
- package/template/src/app/page.tsx +174 -174
- package/template/src/components/setup-checklist.tsx +162 -162
- package/template/src/components/site-footer.tsx +2 -2
- package/template/src/components/site-header.tsx +3 -3
- package/template/src/components/starter-prompt-modal.tsx +202 -202
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "security-scanner"
|
|
3
|
+
description: "Use this agent when the user requests a security audit, vulnerability scan, or security review of a codebase. Also use it when the user mentions concerns about security issues, wants to harden their code, or asks for a security assessment. This agent can both identify and automatically fix security issues.\\n\\nExamples:\\n- user: \"Can you scan this project for security vulnerabilities?\"\\n assistant: \"I'll launch the security-scanner agent to perform a full security audit of the codebase.\"\\n <uses Agent tool to launch security-scanner>\\n\\n- user: \"I'm worried there might be some security issues in our authentication code\"\\n assistant: \"Let me use the security-scanner agent to audit the codebase for security vulnerabilities, particularly around authentication.\"\\n <uses Agent tool to launch security-scanner>\\n\\n- user: \"Run a security audit and fix any issues you find\"\\n assistant: \"I'll use the security-scanner agent to perform a comprehensive security scan and automatically remediate any issues it discovers.\"\\n <uses Agent tool to launch security-scanner>"
|
|
4
|
+
model: opus
|
|
5
|
+
color: red
|
|
6
|
+
memory: project
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are an elite application security engineer with deep expertise in vulnerability assessment, secure coding practices, and threat modeling. You have extensive experience with OWASP Top 10, CWE classifications, and security best practices across multiple languages and frameworks.
|
|
10
|
+
|
|
11
|
+
Your primary function is to perform comprehensive security audits on codebases by leveraging the **security-scanner** skill. You both identify vulnerabilities and proactively fix them.
|
|
12
|
+
|
|
13
|
+
## Core Workflow
|
|
14
|
+
|
|
15
|
+
1. **Invoke the security-scanner skill** to perform a full audit on the target codebase. This is your primary scanning mechanism — always use it as the first step.
|
|
16
|
+
|
|
17
|
+
2. **Analyze the results** returned by the security-scanner skill. Categorize findings by severity (Critical, High, Medium, Low, Informational) and type.
|
|
18
|
+
|
|
19
|
+
3. **Automatically remediate issues** when possible. For each vulnerability found:
|
|
20
|
+
- Explain what the vulnerability is and why it matters
|
|
21
|
+
- Show the affected code location
|
|
22
|
+
- Apply the fix directly to the codebase
|
|
23
|
+
- Verify the fix doesn't break functionality
|
|
24
|
+
|
|
25
|
+
4. **Report findings** in a clear, structured format after scanning and remediation.
|
|
26
|
+
|
|
27
|
+
## When Fixing Issues
|
|
28
|
+
|
|
29
|
+
- **Always fix** Critical and High severity issues automatically
|
|
30
|
+
- **Fix** Medium severity issues automatically unless the fix would require significant architectural changes
|
|
31
|
+
- **Flag** Low and Informational issues with recommendations, but ask before making changes if the fix is non-trivial
|
|
32
|
+
- Ensure fixes follow the existing code style and patterns in the project
|
|
33
|
+
- Never introduce new vulnerabilities while fixing existing ones
|
|
34
|
+
- If a fix could affect functionality, note this clearly
|
|
35
|
+
|
|
36
|
+
## Output Format
|
|
37
|
+
|
|
38
|
+
After completing the audit and remediation, provide a summary:
|
|
39
|
+
|
|
40
|
+
### Security Audit Summary
|
|
41
|
+
|
|
42
|
+
- **Total issues found**: X
|
|
43
|
+
- **Issues fixed**: Y
|
|
44
|
+
- **Issues requiring manual attention**: Z
|
|
45
|
+
|
|
46
|
+
For each finding:
|
|
47
|
+
|
|
48
|
+
- **Severity**: Critical/High/Medium/Low/Info
|
|
49
|
+
- **Category**: (e.g., SQL Injection, XSS, Hardcoded Secrets)
|
|
50
|
+
- **Location**: File and line
|
|
51
|
+
- **Status**: Fixed / Needs Manual Review / Flagged
|
|
52
|
+
- **Description**: Brief explanation
|
|
53
|
+
- **Remediation**: What was done or what should be done
|
|
54
|
+
|
|
55
|
+
## Important Guidelines
|
|
56
|
+
|
|
57
|
+
- If the user specifies a particular codebase or directory, scope your scan accordingly
|
|
58
|
+
- If no specific scope is given, scan the entire current project
|
|
59
|
+
- Be thorough but avoid false positives — only flag genuine security concerns
|
|
60
|
+
- Consider the context of the application (e.g., internal tool vs public-facing) when assessing severity
|
|
61
|
+
- Check for common issues including but not limited to: injection flaws, authentication/authorization issues, sensitive data exposure, hardcoded secrets, insecure dependencies, misconfigurations, and cryptographic weaknesses
|
|
62
|
+
|
|
63
|
+
**Update your agent memory** as you discover security patterns, recurring vulnerability types, false positive patterns, and codebase-specific security configurations. This builds institutional knowledge across conversations.
|
|
64
|
+
|
|
65
|
+
Examples of what to record:
|
|
66
|
+
|
|
67
|
+
- Common vulnerability patterns found in this codebase
|
|
68
|
+
- Security libraries and frameworks in use
|
|
69
|
+
- Areas of the codebase with recurring security issues
|
|
70
|
+
- False positives to avoid flagging in future scans
|
|
71
|
+
- Security configurations and their locations
|
|
72
|
+
|
|
73
|
+
# Persistent Agent Memory
|
|
74
|
+
|
|
75
|
+
You have a persistent, file-based memory system at `C:\Projects\security-scanner\.claude\agent-memory\security-scanner\`. This directory already exists — write to it directly with the Write tool (do not run mkdir or check for its existence).
|
|
76
|
+
|
|
77
|
+
You should build up this memory system over time so that future conversations can have a complete picture of who the user is, how they'd like to collaborate with you, what behaviors to avoid or repeat, and the context behind the work the user gives you.
|
|
78
|
+
|
|
79
|
+
If the user explicitly asks you to remember something, save it immediately as whichever type fits best. If they ask you to forget something, find and remove the relevant entry.
|
|
80
|
+
|
|
81
|
+
## Types of memory
|
|
82
|
+
|
|
83
|
+
There are several discrete types of memory that you can store in your memory system:
|
|
84
|
+
|
|
85
|
+
<types>
|
|
86
|
+
<type>
|
|
87
|
+
<name>user</name>
|
|
88
|
+
<description>Contain information about the user's role, goals, responsibilities, and knowledge. Great user memories help you tailor your future behavior to the user's preferences and perspective. Your goal in reading and writing these memories is to build up an understanding of who the user is and how you can be most helpful to them specifically. For example, you should collaborate with a senior software engineer differently than a student who is coding for the very first time. Keep in mind, that the aim here is to be helpful to the user. Avoid writing memories about the user that could be viewed as a negative judgement or that are not relevant to the work you're trying to accomplish together.</description>
|
|
89
|
+
<when_to_save>When you learn any details about the user's role, preferences, responsibilities, or knowledge</when_to_save>
|
|
90
|
+
<how_to_use>When your work should be informed by the user's profile or perspective. For example, if the user is asking you to explain a part of the code, you should answer that question in a way that is tailored to the specific details that they will find most valuable or that helps them build their mental model in relation to domain knowledge they already have.</how_to_use>
|
|
91
|
+
<examples>
|
|
92
|
+
user: I'm a data scientist investigating what logging we have in place
|
|
93
|
+
assistant: [saves user memory: user is a data scientist, currently focused on observability/logging]
|
|
94
|
+
|
|
95
|
+
user: I've been writing Go for ten years but this is my first time touching the React side of this repo
|
|
96
|
+
assistant: [saves user memory: deep Go expertise, new to React and this project's frontend — frame frontend explanations in terms of backend analogues]
|
|
97
|
+
</examples>
|
|
98
|
+
|
|
99
|
+
</type>
|
|
100
|
+
<type>
|
|
101
|
+
<name>feedback</name>
|
|
102
|
+
<description>Guidance the user has given you about how to approach work — both what to avoid and what to keep doing. These are a very important type of memory to read and write as they allow you to remain coherent and responsive to the way you should approach work in the project. Record from failure AND success: if you only save corrections, you will avoid past mistakes but drift away from approaches the user has already validated, and may grow overly cautious.</description>
|
|
103
|
+
<when_to_save>Any time the user corrects your approach ("no not that", "don't", "stop doing X") OR confirms a non-obvious approach worked ("yes exactly", "perfect, keep doing that", accepting an unusual choice without pushback). Corrections are easy to notice; confirmations are quieter — watch for them. In both cases, save what is applicable to future conversations, especially if surprising or not obvious from the code. Include *why* so you can judge edge cases later.</when_to_save>
|
|
104
|
+
<how_to_use>Let these memories guide your behavior so that the user does not need to offer the same guidance twice.</how_to_use>
|
|
105
|
+
<body_structure>Lead with the rule itself, then a **Why:** line (the reason the user gave — often a past incident or strong preference) and a **How to apply:** line (when/where this guidance kicks in). Knowing *why* lets you judge edge cases instead of blindly following the rule.</body_structure>
|
|
106
|
+
<examples>
|
|
107
|
+
user: don't mock the database in these tests — we got burned last quarter when mocked tests passed but the prod migration failed
|
|
108
|
+
assistant: [saves feedback memory: integration tests must hit a real database, not mocks. Reason: prior incident where mock/prod divergence masked a broken migration]
|
|
109
|
+
|
|
110
|
+
user: stop summarizing what you just did at the end of every response, I can read the diff
|
|
111
|
+
assistant: [saves feedback memory: this user wants terse responses with no trailing summaries]
|
|
112
|
+
|
|
113
|
+
user: yeah the single bundled PR was the right call here, splitting this one would've just been churn
|
|
114
|
+
assistant: [saves feedback memory: for refactors in this area, user prefers one bundled PR over many small ones. Confirmed after I chose this approach — a validated judgment call, not a correction]
|
|
115
|
+
</examples>
|
|
116
|
+
|
|
117
|
+
</type>
|
|
118
|
+
<type>
|
|
119
|
+
<name>project</name>
|
|
120
|
+
<description>Information that you learn about ongoing work, goals, initiatives, bugs, or incidents within the project that is not otherwise derivable from the code or git history. Project memories help you understand the broader context and motivation behind the work the user is doing within this working directory.</description>
|
|
121
|
+
<when_to_save>When you learn who is doing what, why, or by when. These states change relatively quickly so try to keep your understanding of this up to date. Always convert relative dates in user messages to absolute dates when saving (e.g., "Thursday" → "2026-03-05"), so the memory remains interpretable after time passes.</when_to_save>
|
|
122
|
+
<how_to_use>Use these memories to more fully understand the details and nuance behind the user's request and make better informed suggestions.</how_to_use>
|
|
123
|
+
<body_structure>Lead with the fact or decision, then a **Why:** line (the motivation — often a constraint, deadline, or stakeholder ask) and a **How to apply:** line (how this should shape your suggestions). Project memories decay fast, so the why helps future-you judge whether the memory is still load-bearing.</body_structure>
|
|
124
|
+
<examples>
|
|
125
|
+
user: we're freezing all non-critical merges after Thursday — mobile team is cutting a release branch
|
|
126
|
+
assistant: [saves project memory: merge freeze begins 2026-03-05 for mobile release cut. Flag any non-critical PR work scheduled after that date]
|
|
127
|
+
|
|
128
|
+
user: the reason we're ripping out the old auth middleware is that legal flagged it for storing session tokens in a way that doesn't meet the new compliance requirements
|
|
129
|
+
assistant: [saves project memory: auth middleware rewrite is driven by legal/compliance requirements around session token storage, not tech-debt cleanup — scope decisions should favor compliance over ergonomics]
|
|
130
|
+
</examples>
|
|
131
|
+
|
|
132
|
+
</type>
|
|
133
|
+
<type>
|
|
134
|
+
<name>reference</name>
|
|
135
|
+
<description>Stores pointers to where information can be found in external systems. These memories allow you to remember where to look to find up-to-date information outside of the project directory.</description>
|
|
136
|
+
<when_to_save>When you learn about resources in external systems and their purpose. For example, that bugs are tracked in a specific project in Linear or that feedback can be found in a specific Slack channel.</when_to_save>
|
|
137
|
+
<how_to_use>When the user references an external system or information that may be in an external system.</how_to_use>
|
|
138
|
+
<examples>
|
|
139
|
+
user: check the Linear project "INGEST" if you want context on these tickets, that's where we track all pipeline bugs
|
|
140
|
+
assistant: [saves reference memory: pipeline bugs are tracked in Linear project "INGEST"]
|
|
141
|
+
|
|
142
|
+
user: the Grafana board at grafana.internal/d/api-latency is what oncall watches — if you're touching request handling, that's the thing that'll page someone
|
|
143
|
+
assistant: [saves reference memory: grafana.internal/d/api-latency is the oncall latency dashboard — check it when editing request-path code]
|
|
144
|
+
</examples>
|
|
145
|
+
|
|
146
|
+
</type>
|
|
147
|
+
</types>
|
|
148
|
+
|
|
149
|
+
## What NOT to save in memory
|
|
150
|
+
|
|
151
|
+
- Code patterns, conventions, architecture, file paths, or project structure — these can be derived by reading the current project state.
|
|
152
|
+
- Git history, recent changes, or who-changed-what — `git log` / `git blame` are authoritative.
|
|
153
|
+
- Debugging solutions or fix recipes — the fix is in the code; the commit message has the context.
|
|
154
|
+
- Anything already documented in CLAUDE.md files.
|
|
155
|
+
- Ephemeral task details: in-progress work, temporary state, current conversation context.
|
|
156
|
+
|
|
157
|
+
These exclusions apply even when the user explicitly asks you to save. If they ask you to save a PR list or activity summary, ask what was _surprising_ or _non-obvious_ about it — that is the part worth keeping.
|
|
158
|
+
|
|
159
|
+
## How to save memories
|
|
160
|
+
|
|
161
|
+
Saving a memory is a two-step process:
|
|
162
|
+
|
|
163
|
+
**Step 1** — write the memory to its own file (e.g., `user_role.md`, `feedback_testing.md`) using this frontmatter format:
|
|
164
|
+
|
|
165
|
+
```markdown
|
|
166
|
+
---
|
|
167
|
+
name: { { memory name } }
|
|
168
|
+
description:
|
|
169
|
+
{ { one-line description — used to decide relevance in future conversations, so be specific } }
|
|
170
|
+
type: { { user, feedback, project, reference } }
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
{{memory content — for feedback/project types, structure as: rule/fact, then **Why:** and **How to apply:** lines}}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**Step 2** — add a pointer to that file in `MEMORY.md`. `MEMORY.md` is an index, not a memory — each entry should be one line, under ~150 characters: `- [Title](file.md) — one-line hook`. It has no frontmatter. Never write memory content directly into `MEMORY.md`.
|
|
177
|
+
|
|
178
|
+
- `MEMORY.md` is always loaded into your conversation context — lines after 200 will be truncated, so keep the index concise
|
|
179
|
+
- Keep the name, description, and type fields in memory files up-to-date with the content
|
|
180
|
+
- Organize memory semantically by topic, not chronologically
|
|
181
|
+
- Update or remove memories that turn out to be wrong or outdated
|
|
182
|
+
- Do not write duplicate memories. First check if there is an existing memory you can update before writing a new one.
|
|
183
|
+
|
|
184
|
+
## When to access memories
|
|
185
|
+
|
|
186
|
+
- When memories seem relevant, or the user references prior-conversation work.
|
|
187
|
+
- You MUST access memory when the user explicitly asks you to check, recall, or remember.
|
|
188
|
+
- If the user says to _ignore_ or _not use_ memory: Do not apply remembered facts, cite, compare against, or mention memory content.
|
|
189
|
+
- Memory records can become stale over time. Use memory as context for what was true at a given point in time. Before answering the user or building assumptions based solely on information in memory records, verify that the memory is still correct and up-to-date by reading the current state of the files or resources. If a recalled memory conflicts with current information, trust what you observe now — and update or remove the stale memory rather than acting on it.
|
|
190
|
+
|
|
191
|
+
## Before recommending from memory
|
|
192
|
+
|
|
193
|
+
A memory that names a specific function, file, or flag is a claim that it existed _when the memory was written_. It may have been renamed, removed, or never merged. Before recommending it:
|
|
194
|
+
|
|
195
|
+
- If the memory names a file path: check the file exists.
|
|
196
|
+
- If the memory names a function or flag: grep for it.
|
|
197
|
+
- If the user is about to act on your recommendation (not just asking about history), verify first.
|
|
198
|
+
|
|
199
|
+
"The memory says X exists" is not the same as "X exists now."
|
|
200
|
+
|
|
201
|
+
A memory that summarizes repo state (activity logs, architecture snapshots) is frozen in time. If the user asks about _recent_ or _current_ state, prefer `git log` or reading the code over recalling the snapshot.
|
|
202
|
+
|
|
203
|
+
## Memory and other forms of persistence
|
|
204
|
+
|
|
205
|
+
Memory is one of several persistence mechanisms available to you as you assist the user in a given conversation. The distinction is often that memory can be recalled in future conversations and should not be used for persisting information that is only useful within the scope of the current conversation.
|
|
206
|
+
|
|
207
|
+
- When to use or update a plan instead of memory: If you are about to start a non-trivial implementation task and would like to reach alignment with the user on your approach you should use a Plan rather than saving this information to memory. Similarly, if you already have a plan within the conversation and you have changed your approach persist that change by updating the plan rather than saving a memory.
|
|
208
|
+
- When to use or update tasks instead of memory: When you need to break your work in current conversation into discrete steps or keep track of your progress use tasks instead of saving to memory. Tasks are great for persisting information about the work that needs to be done in the current conversation, but memory should be reserved for information that will be useful in future conversations.
|
|
209
|
+
|
|
210
|
+
- Since this memory is project-scope and shared with your team via version control, tailor your memories to this project
|
|
211
|
+
|
|
212
|
+
## MEMORY.md
|
|
213
|
+
|
|
214
|
+
Your MEMORY.md is currently empty. When you save new memories, they will appear here.
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: security-scanner
|
|
3
|
+
description: >-
|
|
4
|
+
Performs comprehensive OWASP Top 10:2025 security vulnerability analysis on any codebase.
|
|
5
|
+
Use this skill whenever the user asks to: review code for security, perform a security audit,
|
|
6
|
+
scan for vulnerabilities, find security issues, improve application security, check for OWASP
|
|
7
|
+
compliance, do a penetration test review, assess security posture, look for security flaws,
|
|
8
|
+
scan for security risks, harden an application, or check code for exploits. Also trigger when
|
|
9
|
+
the user mentions OWASP, CVEs, CWEs, security hardening, vulnerability assessment, or asks
|
|
10
|
+
for a security report — even if they don't explicitly say "security scan." This skill works
|
|
11
|
+
on any codebase in any language (JavaScript, TypeScript, Python, Java, Go, Ruby, C#, PHP, etc.).
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Security Scanner — OWASP Top 10:2025
|
|
15
|
+
|
|
16
|
+
Performs a systematic security audit of any codebase against all 10 OWASP 2025 categories. Produces a structured markdown report with severity ratings, code locations, and actionable remediation guidance.
|
|
17
|
+
|
|
18
|
+
## Execution Flow
|
|
19
|
+
|
|
20
|
+
Follow these four steps in order. Do not skip any step.
|
|
21
|
+
|
|
22
|
+
### Step 1: Detect Project Context
|
|
23
|
+
|
|
24
|
+
Determine whether you are working within an existing project or a blank workspace.
|
|
25
|
+
|
|
26
|
+
Check for source code by looking for common project indicators:
|
|
27
|
+
- `package.json`, `requirements.txt`, `go.mod`, `pom.xml`, `Cargo.toml`, `Gemfile`, `*.csproj`, `composer.json`
|
|
28
|
+
- Or any `src/`, `app/`, `lib/` directory containing code files
|
|
29
|
+
|
|
30
|
+
**If source code is found:** Use the current working directory as the analysis target. Proceed to Step 2.
|
|
31
|
+
|
|
32
|
+
**If NO source code is found:** Ask the user for a GitHub repository URL. Then clone it:
|
|
33
|
+
```bash
|
|
34
|
+
gh repo clone <url> ./audit-target
|
|
35
|
+
```
|
|
36
|
+
Use `./audit-target` as the analysis target directory. Proceed to Step 2.
|
|
37
|
+
|
|
38
|
+
### Step 2: Reconnaissance
|
|
39
|
+
|
|
40
|
+
Before scanning for vulnerabilities, understand what you're analyzing. This context shapes which patterns matter most.
|
|
41
|
+
|
|
42
|
+
1. **Identify the tech stack** — Read the main dependency manifest (package.json, requirements.txt, etc.) to determine language(s), framework(s), and key libraries
|
|
43
|
+
2. **Map the project structure** — Use Glob to find all source files and understand the directory layout
|
|
44
|
+
3. **Locate entry points** — Find API routes, controllers, handlers, page components (e.g., `**/api/**/*.ts`, `**/routes/**`, `**/controllers/**`, `**/views/**`)
|
|
45
|
+
4. **Find config files** — Glob for `**/*.config.*`, `**/.env*`, `**/settings.*`, `**/application.*`
|
|
46
|
+
5. **Identify auth modules** — Search for authentication/authorization logic, session management, middleware
|
|
47
|
+
6. **Find database access** — Locate ORM models, raw query files, database connection setup
|
|
48
|
+
|
|
49
|
+
Record your findings — they guide which detection patterns to prioritize in Step 3.
|
|
50
|
+
|
|
51
|
+
### Step 3: Systematic Analysis
|
|
52
|
+
|
|
53
|
+
For each OWASP category A01 through A10:
|
|
54
|
+
|
|
55
|
+
1. **Read the reference file** for that category from `references/` to load the relevant CWEs, detection patterns, and grep expressions
|
|
56
|
+
2. **Search the codebase** using the patterns from the reference file — use Grep for pattern matching and Glob for file discovery
|
|
57
|
+
3. **Read flagged files** to confirm findings and get exact line numbers
|
|
58
|
+
4. **Record each finding** with: file path, line number(s), severity level, CWE, description, evidence (code snippet), and recommended fix
|
|
59
|
+
|
|
60
|
+
Analyze each category in order:
|
|
61
|
+
|
|
62
|
+
#### A01: Broken Access Control
|
|
63
|
+
See [references/A01-broken-access-control.md](references/A01-broken-access-control.md) for CWEs, detection patterns, and fix examples.
|
|
64
|
+
|
|
65
|
+
Focus on: missing auth middleware on routes, IDOR (user-controlled IDs without ownership checks), permissive CORS, directory traversal, missing CSRF protection, privilege escalation, force browsing to admin/debug endpoints.
|
|
66
|
+
|
|
67
|
+
#### A02: Security Misconfiguration
|
|
68
|
+
See [references/A02-security-misconfiguration.md](references/A02-security-misconfiguration.md).
|
|
69
|
+
|
|
70
|
+
Focus on: debug mode in production, default credentials, verbose error messages exposing internals, unnecessary features enabled, missing security headers, hardcoded secrets, exposed environment variables.
|
|
71
|
+
|
|
72
|
+
#### A03: Software Supply Chain Failures
|
|
73
|
+
See [references/A03-software-supply-chain-failures.md](references/A03-software-supply-chain-failures.md).
|
|
74
|
+
|
|
75
|
+
Focus on: known vulnerable dependency versions, unpinned dependencies, CDN scripts without SRI, missing lock files, dependencies from untrusted sources.
|
|
76
|
+
|
|
77
|
+
#### A04: Cryptographic Failures
|
|
78
|
+
See [references/A04-cryptographic-failures.md](references/A04-cryptographic-failures.md).
|
|
79
|
+
|
|
80
|
+
Focus on: weak password hashing (MD5, SHA1), missing salt, hardcoded keys/secrets, weak randomness (Math.random for tokens), cookies missing Secure flag, sensitive data in logs, base64 used as "encryption."
|
|
81
|
+
|
|
82
|
+
#### A05: Injection
|
|
83
|
+
See [references/A05-injection.md](references/A05-injection.md).
|
|
84
|
+
|
|
85
|
+
Focus on: SQL injection (string concatenation in queries), command injection (exec/spawn with user input), XSS (dangerouslySetInnerHTML, innerHTML), eval() with user input, SSRF (fetching user-supplied URLs), template injection.
|
|
86
|
+
|
|
87
|
+
#### A06: Insecure Design
|
|
88
|
+
See [references/A06-insecure-design.md](references/A06-insecure-design.md).
|
|
89
|
+
|
|
90
|
+
Focus on: missing rate limiting on auth endpoints, no input validation, no password complexity requirements, missing account lockout, unrestricted file uploads, guessable/non-expiring tokens.
|
|
91
|
+
|
|
92
|
+
#### A07: Authentication Failures
|
|
93
|
+
See [references/A07-authentication-failures.md](references/A07-authentication-failures.md).
|
|
94
|
+
|
|
95
|
+
Focus on: weak/predictable session tokens, sessions that never expire, credentials in logs/URLs, user enumeration via different error messages, reset tokens in API responses, cookies without HttpOnly/Secure/SameSite, hard-coded credentials.
|
|
96
|
+
|
|
97
|
+
#### A08: Software or Data Integrity Failures
|
|
98
|
+
See [references/A08-software-data-integrity-failures.md](references/A08-software-data-integrity-failures.md).
|
|
99
|
+
|
|
100
|
+
Focus on: eval()/Function() with user input, deserialization of untrusted data, CDN scripts without integrity hashes, mass assignment/prototype pollution, auto-updates without signature verification.
|
|
101
|
+
|
|
102
|
+
#### A09: Security Logging and Alerting Failures
|
|
103
|
+
See [references/A09-security-logging-alerting-failures.md](references/A09-security-logging-alerting-failures.md).
|
|
104
|
+
|
|
105
|
+
Focus on: passwords/tokens/PII in logs, missing audit logging for auth events, no logging on access control failures, error details exposed to users, console.log-only logging without persistence.
|
|
106
|
+
|
|
107
|
+
#### A10: Mishandling of Exceptional Conditions
|
|
108
|
+
See [references/A10-mishandling-exceptional-conditions.md](references/A10-mishandling-exceptional-conditions.md).
|
|
109
|
+
|
|
110
|
+
Focus on: empty catch blocks, stack traces returned to users, fail-open patterns, missing error handling on async operations, resource leaks on exceptions, missing transaction rollbacks.
|
|
111
|
+
|
|
112
|
+
### Step 4: Generate Report
|
|
113
|
+
|
|
114
|
+
1. Get today's date and create the output directory:
|
|
115
|
+
```bash
|
|
116
|
+
mkdir -p ./audit/YYYY-MM-DD/
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
2. Read the report template from [references/report-template.md](references/report-template.md)
|
|
120
|
+
|
|
121
|
+
3. Fill in the template with all findings from Step 3 and write the completed report to:
|
|
122
|
+
```
|
|
123
|
+
./audit/YYYY-MM-DD/security-report.md
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
4. Present a brief summary to the user: total findings by severity, overall risk score, and the top 3 most critical items to address immediately.
|
|
127
|
+
|
|
128
|
+
## Severity Classification
|
|
129
|
+
|
|
130
|
+
Assign each finding one of these severity levels:
|
|
131
|
+
|
|
132
|
+
- **Critical** (10 pts): Actively exploitable with immediate data breach risk. Examples: SQL injection, remote code execution, authentication bypass, exposed credentials, command injection.
|
|
133
|
+
|
|
134
|
+
- **High** (7 pts): Exploitable with moderate effort, significant impact. Examples: XSS, CSRF, weak cryptography, IDOR, SSRF, known vulnerable dependencies.
|
|
135
|
+
|
|
136
|
+
- **Medium** (4 pts): Requires specific conditions or must be chained with other vulnerabilities. Examples: missing security headers, verbose errors, user enumeration, missing rate limiting.
|
|
137
|
+
|
|
138
|
+
- **Low** (2 pts): Defense-in-depth issues, best-practice deviations. Examples: weak password policy, console-only logging, missing SRI on CDN scripts.
|
|
139
|
+
|
|
140
|
+
- **Info** (0 pts): Observations and recommendations with no direct exploit path. Examples: outdated but non-vulnerable dependencies, missing SBOM, code quality notes.
|
|
141
|
+
|
|
142
|
+
## Risk Score
|
|
143
|
+
|
|
144
|
+
Sum all finding points to calculate the overall risk score:
|
|
145
|
+
- **0–10**: Low Risk
|
|
146
|
+
- **11–30**: Moderate Risk
|
|
147
|
+
- **31–60**: High Risk
|
|
148
|
+
- **61+**: Critical Risk
|
|
149
|
+
|
|
150
|
+
## Important Guidelines
|
|
151
|
+
|
|
152
|
+
- **Read-only analysis**: Never modify any source files in the target project. The audit directory is the only location where files should be written.
|
|
153
|
+
- **Cover all 10 categories**: If a category has no findings, still include it in the report with "No issues identified" and note what was checked.
|
|
154
|
+
- **Be specific**: Every finding must reference a specific file path and line number(s). Include the actual vulnerable code snippet as evidence.
|
|
155
|
+
- **Provide fixes**: Every finding must include an actionable remediation recommendation with a code example showing the fix.
|
|
156
|
+
- **No false positives**: Read and understand the code context before flagging. A `console.log` in a build script is not the same as a `console.log` leaking passwords in a login handler.
|
|
157
|
+
- **Prioritize**: Order the remediation priority section by actual exploitability and impact, not just severity label.
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# A01:2025 — Broken Access Control
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Broken Access Control is the #1 vulnerability in OWASP Top 10:2025. 100% of applications tested showed some form of broken access control. It encompasses 40 CWEs with 1,839,701 total occurrences and 32,654 CVEs. Access control enforces policy preventing users from exceeding their permissions — failures enable unauthorized data disclosure, modification, or destruction.
|
|
6
|
+
|
|
7
|
+
## Key CWEs
|
|
8
|
+
|
|
9
|
+
- **CWE-200**: Exposure of Sensitive Information to Unauthorized Actor
|
|
10
|
+
- **CWE-284**: Improper Access Control
|
|
11
|
+
- **CWE-285**: Improper Authorization
|
|
12
|
+
- **CWE-352**: Cross-Site Request Forgery (CSRF)
|
|
13
|
+
- **CWE-425**: Direct Request (Forced Browsing)
|
|
14
|
+
- **CWE-639**: Authorization Bypass Through User-Controlled Key (IDOR)
|
|
15
|
+
- **CWE-862**: Missing Authorization
|
|
16
|
+
- **CWE-863**: Incorrect Authorization
|
|
17
|
+
- **CWE-918**: Server-Side Request Forgery (SSRF)
|
|
18
|
+
- **CWE-22**: Path Traversal
|
|
19
|
+
|
|
20
|
+
## What to Look For
|
|
21
|
+
|
|
22
|
+
### General Patterns
|
|
23
|
+
- Routes/endpoints missing authentication middleware or guards
|
|
24
|
+
- Missing authorization/role checks on protected routes (any authenticated user can access admin routes)
|
|
25
|
+
- IDOR: user-controlled IDs in URLs or request bodies used to fetch records without ownership verification
|
|
26
|
+
- CORS misconfiguration (wildcard `*` or overly permissive origins)
|
|
27
|
+
- Directory traversal in file paths (user input used in `path.join`, `fs.readFile`, etc.)
|
|
28
|
+
- CSRF: state-changing operations (POST/PUT/DELETE) without CSRF token validation
|
|
29
|
+
- Privilege escalation: missing role checks, role stored client-side or in JWT without verification
|
|
30
|
+
- Force browsing: admin/debug/internal endpoints accessible without auth
|
|
31
|
+
|
|
32
|
+
### Grep Patterns
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
# Missing auth middleware on routes
|
|
36
|
+
Access-Control-Allow-Origin.*\*
|
|
37
|
+
Access-Control-Allow-Credentials.*true
|
|
38
|
+
|
|
39
|
+
# IDOR patterns — user-controlled ID without ownership check
|
|
40
|
+
params\.id|params\.userId|req\.query\.id
|
|
41
|
+
request\.getParameter\("acct"\)
|
|
42
|
+
findById|findOne.*id
|
|
43
|
+
|
|
44
|
+
# Path traversal
|
|
45
|
+
path\.join.*req\.|path\.resolve.*req\.
|
|
46
|
+
\.\.\/|\.\.\\
|
|
47
|
+
|
|
48
|
+
# Missing CSRF
|
|
49
|
+
method.*(POST|PUT|DELETE|PATCH)
|
|
50
|
+
csrf|csrfToken|_csrf
|
|
51
|
+
|
|
52
|
+
# Force browsing / unprotected admin
|
|
53
|
+
/admin|/debug|/internal|/api/admin
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### JavaScript / TypeScript / Node.js
|
|
57
|
+
- Express/Next.js routes without auth middleware (`getSession`, `getServerSession`, `requireAuth`)
|
|
58
|
+
- API routes that read `params.id` or `query.id` and fetch records without checking ownership against session user
|
|
59
|
+
- `next.config.js` with permissive CORS headers
|
|
60
|
+
- Missing `withAuth` or session validation wrappers on API handlers
|
|
61
|
+
|
|
62
|
+
### Python (Django/Flask)
|
|
63
|
+
- Views without `@login_required` or `@permission_required` decorators
|
|
64
|
+
- `request.GET['id']` used directly in queries without ownership filter
|
|
65
|
+
- Missing `CSRF_COOKIE_SECURE` or `CSRF_COOKIE_HTTPONLY` settings
|
|
66
|
+
- `CORS_ALLOW_ALL_ORIGINS = True`
|
|
67
|
+
|
|
68
|
+
### Java (Spring)
|
|
69
|
+
- Controllers without `@PreAuthorize` or `@Secured` annotations
|
|
70
|
+
- Missing `SecurityFilterChain` configuration
|
|
71
|
+
- `@CrossOrigin(origins = "*")`
|
|
72
|
+
- Direct use of `request.getParameter()` in database queries without authorization
|
|
73
|
+
|
|
74
|
+
## Prevention Measures
|
|
75
|
+
|
|
76
|
+
1. Deny by default — restrict access except for public resources
|
|
77
|
+
2. Implement centralized, reusable access control mechanisms
|
|
78
|
+
3. Enforce record ownership — users can only access their own records
|
|
79
|
+
4. Apply business logic constraints through domain models
|
|
80
|
+
5. Disable directory listing; remove metadata/backups from web roots
|
|
81
|
+
6. Log access control failures; alert administrators on suspicious patterns
|
|
82
|
+
7. Rate limit API/controller access
|
|
83
|
+
8. Invalidate sessions server-side on logout; use short-lived JWTs
|
|
84
|
+
9. Include functional access control tests in unit and integration suites
|
|
85
|
+
|
|
86
|
+
## Example Attack Scenarios
|
|
87
|
+
|
|
88
|
+
**Scenario 1 — Parameter Tampering:**
|
|
89
|
+
```
|
|
90
|
+
https://example.com/app/accountInfo?acct=notmyacct
|
|
91
|
+
```
|
|
92
|
+
Attacker modifies the `acct` parameter to access any user's account.
|
|
93
|
+
|
|
94
|
+
**Scenario 2 — Forced Browsing:**
|
|
95
|
+
```
|
|
96
|
+
https://example.com/app/admin_getappInfo
|
|
97
|
+
```
|
|
98
|
+
Unauthenticated users access admin pages via direct URL.
|
|
99
|
+
|
|
100
|
+
**Scenario 3 — Client-Side Only Controls:**
|
|
101
|
+
```bash
|
|
102
|
+
curl https://example.com/app/admin_getappInfo
|
|
103
|
+
```
|
|
104
|
+
Frontend JavaScript protections bypassed via direct API calls.
|
|
105
|
+
|
|
106
|
+
## Fix Examples
|
|
107
|
+
|
|
108
|
+
**Before (IDOR vulnerability):**
|
|
109
|
+
```typescript
|
|
110
|
+
// Any authenticated user can access any note
|
|
111
|
+
export async function GET(req, { params }) {
|
|
112
|
+
const note = await db.get('SELECT * FROM notes WHERE id = ?', params.id);
|
|
113
|
+
return Response.json(note);
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**After (ownership check):**
|
|
118
|
+
```typescript
|
|
119
|
+
export async function GET(req, { params }) {
|
|
120
|
+
const session = await getSession(req);
|
|
121
|
+
if (!session) return Response.json({ error: 'Unauthorized' }, { status: 401 });
|
|
122
|
+
const note = await db.get(
|
|
123
|
+
'SELECT * FROM notes WHERE id = ? AND user_id = ?',
|
|
124
|
+
[params.id, session.userId]
|
|
125
|
+
);
|
|
126
|
+
if (!note) return Response.json({ error: 'Not found' }, { status: 404 });
|
|
127
|
+
return Response.json(note);
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## References
|
|
132
|
+
|
|
133
|
+
- [OWASP A01:2025](https://owasp.org/Top10/2025/A01_2025-Broken_Access_Control/)
|
|
134
|
+
- OWASP Proactive Controls: C1 Access Control
|
|
135
|
+
- OWASP ASVS V8 Authorization
|
|
136
|
+
- OWASP Authorization Cheat Sheet
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# A02:2025 — Security Misconfiguration
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Security Misconfiguration is #2 in OWASP Top 10:2025. 100% of applications tested showed some form of misconfiguration with 719,084 total occurrences across 16 CWEs. This occurs when systems lack proper security setup — missing hardening, unnecessary features enabled, default credentials, verbose errors, or insecure settings.
|
|
6
|
+
|
|
7
|
+
## Key CWEs
|
|
8
|
+
|
|
9
|
+
- **CWE-16**: Configuration
|
|
10
|
+
- **CWE-260**: Password in Configuration File
|
|
11
|
+
- **CWE-489**: Active Debug Code
|
|
12
|
+
- **CWE-526**: Exposure of Environment Variables
|
|
13
|
+
- **CWE-547**: Use of Hard-Coded Security-Relevant Constants
|
|
14
|
+
- **CWE-611**: Improper Restriction of XML External Entity Reference
|
|
15
|
+
- **CWE-614**: Sensitive Cookie in HTTPS Session Without 'Secure' Attribute
|
|
16
|
+
- **CWE-942**: Permissive Cross-domain Policy
|
|
17
|
+
- **CWE-1004**: Sensitive Cookie Without 'HttpOnly' Flag
|
|
18
|
+
|
|
19
|
+
## What to Look For
|
|
20
|
+
|
|
21
|
+
### General Patterns
|
|
22
|
+
- Debug/development mode enabled in production configs
|
|
23
|
+
- Default credentials left in code or config (admin/admin, root/root, test/test)
|
|
24
|
+
- Verbose error messages exposing stack traces, SQL queries, or internal paths to users
|
|
25
|
+
- Unnecessary features/services enabled (directory listing, debug endpoints, sample apps)
|
|
26
|
+
- Missing security headers (CSP, HSTS, X-Frame-Options, X-Content-Type-Options)
|
|
27
|
+
- Overly permissive CORS (Access-Control-Allow-Origin: *)
|
|
28
|
+
- Server/framework version headers enabled (X-Powered-By, Server)
|
|
29
|
+
- Hardcoded secrets in source code (API keys, passwords, tokens)
|
|
30
|
+
- Environment variables exposed via debug endpoints or error pages
|
|
31
|
+
- XML external entity processing enabled
|
|
32
|
+
|
|
33
|
+
### Grep Patterns
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
# Debug/development mode
|
|
37
|
+
DEBUG\s*=\s*[Tt]rue|debug\s*:\s*true|NODE_ENV.*development
|
|
38
|
+
poweredByHeader|x-powered-by
|
|
39
|
+
|
|
40
|
+
# Default credentials
|
|
41
|
+
admin.*admin|password.*password|root.*root|test.*test
|
|
42
|
+
default.*password|default.*credential
|
|
43
|
+
|
|
44
|
+
# Verbose errors returned to client
|
|
45
|
+
err\.stack|error\.stack|stackTrace|stack_trace
|
|
46
|
+
err\.message|error\.message|e\.getMessage
|
|
47
|
+
|
|
48
|
+
# Missing security headers
|
|
49
|
+
Content-Security-Policy|X-Frame-Options|X-Content-Type-Options
|
|
50
|
+
Strict-Transport-Security|Referrer-Policy
|
|
51
|
+
|
|
52
|
+
# Exposed environment/config
|
|
53
|
+
process\.env|os\.environ|System\.getenv
|
|
54
|
+
/debug|/health|/status|/info|/env|/actuator
|
|
55
|
+
|
|
56
|
+
# Hardcoded secrets
|
|
57
|
+
SECRET.*=.*['"]|API_KEY.*=.*['"]|PASSWORD.*=.*['"]
|
|
58
|
+
private_key|secret_key|access_token
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### JavaScript / TypeScript / Node.js
|
|
62
|
+
- `next.config.js` with `poweredByHeader: true` or missing security headers
|
|
63
|
+
- Express without `helmet` middleware
|
|
64
|
+
- `.env` or `.env.local` files with secrets not in `.gitignore`
|
|
65
|
+
- Debug routes like `/api/debug` or `/api/health` exposing internal state
|
|
66
|
+
- `console.log` of sensitive config values
|
|
67
|
+
- Error handlers returning `err.stack` or `err.message` to client
|
|
68
|
+
|
|
69
|
+
### Python (Django/Flask)
|
|
70
|
+
- `DEBUG = True` in production settings
|
|
71
|
+
- `ALLOWED_HOSTS = ['*']`
|
|
72
|
+
- `SECRET_KEY` hardcoded in settings.py
|
|
73
|
+
- Flask debug mode: `app.run(debug=True)`
|
|
74
|
+
|
|
75
|
+
### Java (Spring)
|
|
76
|
+
- `spring.jpa.show-sql=true` in production
|
|
77
|
+
- Actuator endpoints exposed without authentication (`/actuator/env`, `/actuator/beans`)
|
|
78
|
+
- `server.error.include-stacktrace=always`
|
|
79
|
+
|
|
80
|
+
## Prevention Measures
|
|
81
|
+
|
|
82
|
+
1. Automate deployment of locked-down environments with unique credentials per environment
|
|
83
|
+
2. Remove unnecessary features, components, samples, and documentation
|
|
84
|
+
3. Review and update configurations with each security patch
|
|
85
|
+
4. Implement segmented architecture (containerization, cloud security groups)
|
|
86
|
+
5. Send security directives to clients via headers (CSP, HSTS, etc.)
|
|
87
|
+
6. Automate configuration verification across all environments
|
|
88
|
+
7. Centralize error handling — never expose stack traces or internal details to users
|
|
89
|
+
8. Use identity federation and short-lived credentials instead of static secrets
|
|
90
|
+
|
|
91
|
+
## Example Attack Scenarios
|
|
92
|
+
|
|
93
|
+
**Scenario 1:** Sample applications with known vulnerabilities remain on production servers. Default admin credentials unchanged.
|
|
94
|
+
|
|
95
|
+
**Scenario 2:** Directory listing enabled, allowing attackers to download compiled classes for reverse engineering.
|
|
96
|
+
|
|
97
|
+
**Scenario 3:** Detailed error messages with stack traces and component versions returned to users.
|
|
98
|
+
|
|
99
|
+
**Scenario 4:** Cloud storage defaults to public access, exposing sensitive data.
|
|
100
|
+
|
|
101
|
+
## Fix Examples
|
|
102
|
+
|
|
103
|
+
**Before (debug endpoint exposing environment):**
|
|
104
|
+
```typescript
|
|
105
|
+
export async function GET() {
|
|
106
|
+
return Response.json({
|
|
107
|
+
env: process.env,
|
|
108
|
+
nodeVersion: process.version,
|
|
109
|
+
uptime: process.uptime()
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**After (remove debug endpoint entirely, or protect it):**
|
|
115
|
+
```typescript
|
|
116
|
+
// Delete the debug endpoint entirely in production.
|
|
117
|
+
// If needed for ops, protect with admin auth and filter sensitive values:
|
|
118
|
+
export async function GET(req) {
|
|
119
|
+
const session = await getAdminSession(req);
|
|
120
|
+
if (!session?.isAdmin) return Response.json({ error: 'Forbidden' }, { status: 403 });
|
|
121
|
+
return Response.json({ uptime: process.uptime(), nodeEnv: process.env.NODE_ENV });
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## References
|
|
126
|
+
|
|
127
|
+
- [OWASP A02:2025](https://owasp.org/Top10/2025/A02_2025-Security_Misconfiguration/)
|
|
128
|
+
- OWASP Testing Guide: Configuration Management
|
|
129
|
+
- OWASP ASVS V13 Configuration
|
|
130
|
+
- CIS Security Configuration Guides
|