Back to skill

Security audit

fswe

Security checks for vulnerabilities and agentic risk

Overview

This is a Markdown-only full-stack guidance skill, but several production-facing templates show unsafe auth, deletion, feature-flag, WebSocket token, and CI patterns that users should review before installing.

Review generated code before using it in production. In particular, remove client-controlled role assignment from public registration, require explicit authorization and audit logging for destructive routes and feature-flag changes, avoid putting auth tokens in URLs, and pin CI actions to reviewed commit SHAs with least-privilege workflow permissions.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
Findings (3)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
references/api-development/SKILL.md:69
Finding
Unauthenticated User Registration Allows Administrative Role Assignment<![CDATA[ ## Vulnerability Details **File Location**: `references/api-development/SKILL.md`, lines 69–74 and 117–126 **Vulnerability Type**: Unauthenticated privilege assignment / mass assignment **Risk Level**: High ### Vulnerable Code ```typescript // POST /users router.post('/users', validateRequest(createUserSchema), async (req: Request, res: Response, next: NextFunction) => { try { const user = await userService.create(req.body) res.status(201).json(user) } catch (err) { next(err) } } ) ``` ```typescript export const createUserSchema = z.object({ body: z.object({ email: z.string().email('Invalid email format'), name: z.string().min(1, 'Name is required').max(100), password: z.string() .min(8, 'Password must be at least 8 characters') .regex(/[A-Z]/, 'Password must contain uppercase') .regex(/[0-9]/, 'Password must contain number'), role: z.enum(['user', 'admin']).default('user'), }), }) ``` ### Technical Analysis The example exposes `POST /users` without authentication or authorization middleware. Its validation schema permits the caller to submit either `user` or `admin` as the account role. The complete validated request body is then passed directly to `userService.create()`. A default value of `user` does not prevent exploitation because it is only applied when the caller omits the field. An attacker can explicitly provide `"role": "admin"`, which passes schema validation. This is an insecure mass-assignment pattern and violates the rule that authorization-sensitive properties must be assigned exclusively by trusted server-side logic. Because this Skill is intended to provide reusable production templates, applications adopting the example without correction may inherit the vulnerability. ### Attack Path 1. An unauthenticated attacker identifies the public `POST /users` endpoint. 2. The attacker submits a request such as: ```json { "email": "attacker@example.com", "na ...[truncated 843 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove `role` and every other authorization-sensitive field from the public registration schema. 2. Assign the least-privileged role in trusted server-side code, regardless of submitted input: ```typescript const publicRegistrationSchema = z.object({ body: z.object({ email: z.string().email(), name: z.string().min(1).max(100), password: z.string() .min(8) .regex(/[A-Z]/) .regex(/[0-9]/), }).strict(), }) const user = await userService.create({ ...req.body, role: 'user', }) ``` 3. Use `.strict()` or an equivalent allowlist mechanism to reject unknown properties instead of silently accepting or forwarding them. 4. Create a separate administrative endpoint for role assignment. 5. Protect that endpoint with both authentication and explicit authorization, such as `authenticate` followed by `authorize('admin')`. 6. Enforce authorization again in the service or domain layer so route-level middleware is not the only protection. 7. Add negative tests confirming that public registration cannot set `role`, permissions, ownership identifiers, account status, or similar privileged fields. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
references/websocket-realtime/SKILL.md:14
Finding
WebSocket Guidance Permits Authentication Tokens in Query Strings<![CDATA[ ## Vulnerability Details **File Location**: `references/websocket-realtime/SKILL.md`, line 14 **Vulnerability Type**: Sensitive credential exposure through URL query parameters **Risk Level**: Medium ### Vulnerable Code ```markdown - [ ] Authenticate on connect (token in query or first message) ``` ### Technical Analysis The guidance explicitly permits placing an authentication token in a WebSocket connection query string. URLs are commonly recorded by reverse proxies, load balancers, application access logs, observability platforms, error reports, and browser history. Query parameters may therefore expose bearer credentials to systems and personnel that do not require authentication access. TLS protects the URL while it is transmitted over the network, but it does not prevent endpoints or intermediary infrastructure from recording the URL. Any bearer token recovered from such a record may be replayed until it expires or is revoked. ### Attack Path 1. A client opens a connection using a URL such as `wss://service.example/socket?token=BEARER_TOKEN`. 2. A reverse proxy, gateway, application server, or monitoring platform records the complete request URL. 3. An attacker or unauthorized operator obtains access to the relevant logs, traces, reports, or browser history. 4. The party extracts the bearer token from the query string. 5. The token is replayed to establish a WebSocket or related authenticated session. 6. The attacker acts with the privileges associated with the affected user until the token expires or is revoked. ### Impact Assessment The exposed privilege level is equal to that of the compromised token. Depending on application functionality, an attacker may subscribe to private channels, read real-time user data, send messages as the victim, invoke authenticated events, or access other APIs that accept the same bearer token. Exposure may also propagate into centralized logging and monitoring systems, widening the number of people and s ...[truncated 46 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove query-string tokens from the recommended authentication methods. 2. Prefer secure, `HttpOnly`, `Secure`, and appropriately scoped cookies when the deployment and cross-origin model support them. 3. Otherwise, issue a short-lived, audience-restricted, single-use WebSocket connection ticket through an authenticated HTTPS request. 4. Redeem and invalidate that ticket during connection establishment so a logged value cannot be reused. 5. If protocol-level authentication is used, transmit credentials in the first WebSocket message over TLS and reject all other messages until authentication succeeds. 6. Use short token lifetimes and implement revocation and rotation. 7. Configure gateways, proxies, and observability systems to redact authentication parameters and headers. 8. Validate the WebSocket `Origin` where applicable and separately authorize every room or channel subscription. ]]>

T08 · Insecure Dependencies

Warning
Location
references/ci-cd-pipelines/SKILL.md:34
Finding
GitHub Actions Templates Execute Dependencies Referenced by Mutable Version Tags<![CDATA[ ## Vulnerability Details **File Location**: `references/ci-cd-pipelines/SKILL.md`, lines 34–54; related guidance at line 76 **Vulnerability Type**: CI/CD supply-chain exposure through mutable Action references **Risk Level**: Medium ### Vulnerable Code ```yaml steps: - uses: actions/checkout@v4 - uses: oven-sh/setup-bun@v2 - run: bun install --frozen-lockfile - run: bun run lint - run: bun run typecheck ``` ```yaml steps: - uses: actions/checkout@v4 - uses: oven-sh/setup-bun@v2 - run: bun install --frozen-lockfile - run: bun test --coverage ``` ```yaml steps: - uses: actions/checkout@v4 - run: ./scripts/deploy.sh ``` The accompanying checklist states: ```markdown - [ ] Pin action versions (`actions/checkout@v4`, not `@main`) ``` ### Technical Analysis References such as `actions/checkout@v4` and `oven-sh/setup-bun@v2` are mutable Git tags, not immutable dependency pins. The repository controlling an Action can move or replace such a tag, and a compromise of the upstream publisher or release process could cause future workflow runs to execute different code without any change in the consuming repository. The checklist incorrectly treats a major-version tag as sufficient pinning. GitHub Actions execute code on the workflow runner and may have access to checked-out source, generated artifacts, the workflow token, repository metadata, and any secrets deliberately exposed to the relevant job. No explicit top-level or job-level `permissions` declaration is included in the template, so the workflow also fails to document and enforce a deliberate least-privilege token policy. ### Attack Path 1. A project adopts the supplied workflow template. 2. An upstream Action publisher account, repository, release process, or mutable major-version tag is compromised. 3. The tag referenced by the workflow is moved to malicious Action code. 4. A push or pull-request event triggers the workflow. 5. The runner downloads and executes the chang ...[truncated 826 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin every third-party Action to a reviewed full commit SHA: ```yaml - uses: actions/checkout@FULL_COMMIT_SHA - uses: oven-sh/setup-bun@FULL_COMMIT_SHA ``` 2. Retain the human-readable release version in a comment and use Dependabot or Renovate to propose reviewed SHA updates. 3. Correct the checklist to state that tags such as `@v4`, `@v2`, and `@main` are mutable; only a full commit SHA provides an immutable reference. 4. Declare explicit least-privilege workflow permissions, for example: ```yaml permissions: contents: read ``` 5. Grant elevated permissions only to the specific job that requires them. 6. Keep deployment jobs in protected environments with mandatory approval and narrowly scoped credentials. 7. Avoid exposing secrets to pull-request workflows, particularly workflows that can execute untrusted contributor code. 8. Review Action publishers, monitor upstream security advisories, and allow only approved Actions where organizational controls are available. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (18)

Tool Parameter Abuse

High
Category
Tool Misuse
Content
}
)

// DELETE /users/:id
router.delete('/users/:id',
  authenticate,
  async (req: Request, res: Response, next: NextFunction) => {
Confidence
80% confidence
Finding
The example exposes a destructive DELETE /users/:id route with authentication only and no authorization or ownership check shown. In a skill meant to teach API development, this pattern can normalize unsafe deletion logic and could lead implementers to ship an IDOR-style or privilege-escalation vulnerability where any authenticated user can delete arbitrary accounts.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
POST   /api/v1/users          → Create
GET    /api/v1/users/:id      → Read
PATCH  /api/v1/users/:id      → Update
DELETE /api/v1/users/:id      → Delete
```

### Status Codes
Confidence
80% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
router.get('/users', userController.findAll)

// Phase 3: Remove legacy dependency
// DELETE /users from PHP
```

## Risk Mapping
Confidence
80% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Vague Triggers

Medium
Confidence
90% confidence
Finding
The changelog states that the skill can auto-select routing based on input keywords, but provides no boundaries on which inputs trigger routing, how routing decisions are constrained, or whether user confirmation is required. In an agent skill, ambiguous activation logic can cause unintended module invocation, broaden the attack surface for prompt-trigger manipulation, and lead to behavior the user did not explicitly request.

Vague Triggers

Medium
Confidence
90% confidence
Finding
The README says the skill 'automatically routes to the right module based on your input keywords' but does not specify which keywords trigger which modules or what inputs should not activate routing. For a markdown file, this creates an ambiguous activation condition that could cause unintended module selection.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The phrase 'English-only' is a natural-language locale restriction. Although the parameters table lists multiple language options, this line explicitly imposes a single language without opt-in or justification, which conflicts with the policy against forced language constraints.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The markdown defines activation/routing based on generic keywords such as "test," "slow," "service," "debug," "production," and "ownership," many of which overlap with common engineering conversation. The file does not provide exclusion conditions or negative examples to clarify when these keywords should not trigger a module, making the trigger scope ambiguous.

External Transmission

Medium
Category
Data Exfiltration
Content
description: API for EazyCam webcam service

servers:
  - url: https://api.eazycam.com/v1
  - url: http://localhost:3000/v1

paths:
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The example exposes a state-changing kill-switch action over a GET route and allows toggling feature flags based solely on a query parameter, with no authentication, authorization, CSRF protection, or operator confirmation shown. In skill context, this is more dangerous because it is presented as reusable implementation guidance, so readers may copy an insecure administrative control path directly into production systems.

Natural-Language Policy Violations

Low
Confidence
84% confidence
Finding
The natural-language note says mixed Indonesian/English was removed in favor of full English, which suggests a forced language choice. There is no indication here that users can opt into another language or that the English-only constraint is justified by a region-specific requirement.

Missing User Warnings

Low
Confidence
79% confidence
Finding
This markdown file includes a DELETE /users/:id example that performs user deletion, but the surrounding documentation does not warn readers that the operation is destructive or irreversible. For markdown files, the skill description should disclose behaviors that may affect user data or system integrity.

Intent-Code Divergence

Low
Confidence
93% confidence
Finding
The OpenAPI section specifies that GET /users returns an object with `data` and `meta` fields, indicating a standardized paginated response. In the controller example, the same endpoint sends `res.json(users)` directly, which contradicts the documented response shape rather than merely omitting detail.

Intent-Code Divergence

Low
Confidence
84% confidence
Finding
The checklist explicitly calls for role-based authorization, and the file defines an `authorize` middleware for that purpose. However, the route examples only use `authenticate`, so the documented intent around authorization is not reflected in the shown implementation.

Natural-Language Policy Violations

Low
Confidence
82% confidence
Finding
The markdown specifies a `language` parameter with default `en`, which can amount to a language preference being imposed unless the invoking system explicitly asks the user. Under the policy, language constraints should be opt-in or clearly justified; this file provides a fixed default but no instruction to obtain user choice first.

Missing User Warnings

Low
Confidence
84% confidence
Finding
The example shows logging a user identifier directly, which can normalize inclusion of potentially sensitive identifiers in application logs without any caution about minimization, masking, or retention controls. While a user ID is not always highly sensitive by itself, logs are often widely accessible and long-lived, so exposing identifiers can increase privacy risk and aid correlation of user activity.

Natural-Language Policy Violations

Low
Confidence
81% confidence
Finding
The parameters specify `language` with a default of `en` and allowed values `en, id`, which sets a specific language by default. Under the policy, forcing a language without explicit user opt-in can be a natural-language policy issue unless the locale constraint is clearly justified.

Natural-Language Policy Violations

Low
Confidence
81% confidence
Finding
The parameter table sets `language` default to `en` while only listing `en, id`, which imposes a language choice unless the user overrides it. Under the policy, forcing a specific language without opt-in can be a natural-language locale violation when no justification is provided.

Natural-Language Policy Violations

Low
Confidence
97% confidence
Finding
Line L26 instructs sending the literal `心跳`, which is Chinese text, while the parameters indicate a default language of `en` and only list `en, id`. This introduces a language/locale inconsistency in the skill guidance without documenting why non-English output is required or giving the user a choice at that point.

Static analysis

No suspicious patterns detected.