Back to skill

Security audit

Api Designer

Security checks for vulnerabilities and agentic risk

Overview

This is a documentation-only API design skill with no execution hooks; the main caveat is one weak pagination-security recommendation users should review.

Install only if you want API design assistance. Treat generated pagination cursor designs as drafts and require signed or otherwise integrity-protected cursors, strict validation, and authorization checks before implementation.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
references/pagination.md:129
Finding

Unsigned Base64 Pagination Cursors Are Client-Tamperable

Content
View full analysis

Vulnerability Details

File Location: references/pagination.md, lines 129–132 and 157
Vulnerability Type: Unsigned and tamperable pagination cursor
Risk Level: Medium

Vulnerable Code Snippet:

markdown
**Cursor structure (base64 encoded):**
```json
{"id": 30, "sort": "created_at"}
text

The same document later makes the following unsafe assumption:

```markdown
- Cursor is opaque (users can't modify it)

Technical Analysis

The guidance recommends encoding cursor state as Base64 and incorrectly implies that users cannot modify it. Base64 only transforms data into another representation; it provides no confidentiality, authenticity, or integrity protection.

A client can decode the cursor, modify fields such as the record identifier, timestamp, or sorting state, and then re-encode it. If an API implementation trusts those values without cryptographic verification and strict server-side validation, the attacker can manipulate pagination boundaries.

The risk becomes more significant if a cursor contains tenant identifiers, authorization scope, filters, or other security-relevant state. Authorization must never depend solely on untrusted cursor contents.

Attack Path

  1. An attacker makes a legitimate collection request and receives a Base64-encoded cursor.
  2. The attacker Base64-decodes the cursor and obtains its JSON payload.
  3. The attacker changes fields such as id, created_at, sorting state, filters, or scope identifiers.
  4. The attacker Base64-encodes the altered payload.
  5. The modified cursor is submitted to the API.
  6. If the server trusts the decoded cursor without checking its integrity, the manipulated state controls the subsequent database query.
  7. Depending on the implementation, this may expose records outside intended pagination boundaries or bypass enforced filter state.

Impact Assessment

Successful exploitation may allow an unauthenticated or ordinarily authenticated API client to manipulate pagin ...[truncated 598 chars]

Remediation
View remediation

Remediation Suggestions

  1. Protect cursor integrity using an HMAC with a server-held secret, or use authenticated encryption such as AES-GCM when cursor confidentiality is also required.
  2. Verify the signature before decoding or using cursor-controlled state. Reject unsigned cursors and cursors with invalid signatures.
  3. Bind each cursor to the authenticated user or tenant, original filter set, sort order, page-size constraints, and an expiration time.
  4. Validate the decoded payload against a strict schema, including allowed fields, types, ranges, and sort-field allowlists.
  5. Use parameterized database queries and never concatenate cursor values into SQL.
  6. Reapply authorization and tenant restrictions independently on every paginated request. Do not rely on authorization scope stored in the cursor.
  7. Return a generic invalid-cursor response without revealing signing, parsing, database, or internal implementation details.
  8. Replace the unsafe statement with guidance explaining that Base64 provides opacity only and does not prevent modification.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (17)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/error-handling.md (reported line 131)May include surrounding context.

md
{
  "error": {
    "code": "INVALID_TOKEN",
    "message": "The access token is invalid or has expired",
    "details": {
      "reason": "token_expired",
      "expired_at": "2024-01-15T10:00:00Z"

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/openapi.md (reported line 436)May include surrounding context.

md
{
  "error": {
    "code": "INVALID_TOKEN",
    "message": "The access token is invalid or has expired",
    "details": {
      "reason": "token_expired",
      "expired_at": "2024-01-15T10:00:00Z"

Tool Parameter Abuse

High
Category
Tool Misuse
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).

Content

Scanner excerpt · references/rest-patterns.md (reported line 17)May include surrounding context.

POST /users # Create resource PUT /users/{id} # Replace resource PATCH /users/{id} # Update resource DELETE /users/{id} # Delete resource

text

**Bad Resource URIs:**

Tool Parameter Abuse

High
Category
Tool Misuse
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).

Content

Scanner excerpt · references/error-handling.md (reported line 151)May include surrounding context.

DELETE - Remove Resource

http
DELETE /users/123

Response: 204 No Content

Tool Parameter Abuse

High
Category
Tool Misuse
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).

Content

Scanner excerpt · references/rest-patterns.md (reported line 123)May include surrounding context.

DELETE - Remove Resource

http
DELETE /users/123

Response: 204 No Content

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
80% confidence
Finding

Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.

Content

Scanner excerpt · references/versioning.md (reported line 377)May include surrounding context.

md
5. **Maintain old versions** - Support at least 2 versions simultaneously
6. **Document changes** - Provide detailed migration guides
7. **Use semantic versioning** - For internal/SDK versioning
8. **Never break without warning** - Always announce breaking changes
9. **Provide tools** - Migration scripts, updated SDKs
10. **Monitor usage** - Track which versions are being used

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
80% confidence
Finding

Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.

Content

Scanner excerpt · references/versioning.md (reported line 389)May include surrounding context.

md
5. **Maintain old versions** - Support at least 2 versions simultaneously
6. **Document changes** - Provide detailed migration guides
7. **Use semantic versioning** - For internal/SDK versioning
8. **Never break without warning** - Always announce breaking changes
9. **Provide tools** - Migration scripts, updated SDKs
10. **Monitor usage** - Track which versions are being used

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/error-handling.md (reported line 30)May include surrounding context.

md
Content-Type: application/problem+json

{
  "type": "https://api.example.com/errors/resource-not-found",
  "title": "Resource Not Found",
  "status": 404,
  "detail": "User with ID 123 does not exist",

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/error-handling.md (reported line 66)May include surrounding context.

md
Content-Type: application/problem+json

{
  "type": "https://api.example.com/errors/resource-not-found",
  "title": "Resource Not Found",
  "status": 404,
  "detail": "User with ID 123 does not exist",

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/openapi.md (reported line 31)May include surrounding context.

md
Content-Type: application/problem+json

{
  "type": "https://api.example.com/errors/resource-not-found",
  "title": "Resource Not Found",
  "status": 404,
  "detail": "User with ID 123 does not exist",

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/openapi.md (reported line 119)May include surrounding context.

md
Content-Type: application/problem+json

{
  "type": "https://api.example.com/errors/resource-not-found",
  "title": "Resource Not Found",
  "status": 404,
  "detail": "User with ID 123 does not exist",

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/versioning.md (reported line 236)May include surrounding context.

md
Content-Type: application/problem+json

{
  "type": "https://api.example.com/errors/resource-not-found",
  "title": "Resource Not Found",
  "status": 404,
  "detail": "User with ID 123 does not exist",

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/versioning.md (reported line 314)May include surrounding context.

md
Content-Type: application/problem+json

{
  "type": "https://api.example.com/errors/resource-not-found",
  "title": "Resource Not Found",
  "status": 404,
  "detail": "User with ID 123 does not exist",

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/versioning.md (reported line 318)May include surrounding context.

md
Content-Type: application/problem+json

{
  "type": "https://api.example.com/errors/resource-not-found",
  "title": "Resource Not Found",
  "status": 404,
  "detail": "User with ID 123 does not exist",

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/versioning.md (reported line 322)May include surrounding context.

md
Content-Type: application/problem+json

{
  "type": "https://api.example.com/errors/resource-not-found",
  "title": "Resource Not Found",
  "status": 404,
  "detail": "User with ID 123 does not exist",

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/versioning.md (reported line 362)May include surrounding context.

md
Content-Type: application/problem+json

{
  "type": "https://api.example.com/errors/resource-not-found",
  "title": "Resource Not Found",
  "status": 404,
  "detail": "User with ID 123 does not exist",

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/versioning.md (reported line 364)May include surrounding context.

md
Content-Type: application/problem+json

{
  "type": "https://api.example.com/errors/resource-not-found",
  "title": "Resource Not Found",
  "status": 404,
  "detail": "User with ID 123 does not exist",

Static analysis

No suspicious patterns detected.