Back to skill

Security audit

Sovereign API Hardener

Security checks for vulnerabilities and agentic risk

Overview

This is a documentation-only API hardening skill with coherent security guidance and no hidden execution, persistence, or data access behavior.

This skill is reasonable to install for API security review. Treat its snippets as starting points, especially the logging examples: redact or hash identifiers, avoid arbitrary object logging, and verify recommended middleware settings against your framework and deployment.

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
SKILL.md:600
Finding

Unredacted Personally Identifiable Information in Security Logs

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:600-610
Vulnerability Type: Sensitive data exposure through insecure logging
Risk Level: Medium

javascript
function logSecurityEvent(event, details) {
  logger.warn({
    type: 'security',
    event,
    ...details,
    timestamp: new Date().toISOString()
  });
}

// Usage in auth middleware
logSecurityEvent('login_failed', { email: req.body.email, ip: req.ip });

Technical Analysis

The recommended security-logging function spreads the arbitrary details object directly into a log record without an allowlist, redaction, validation, or pseudonymization. Its example invocation explicitly records a user's email address and full IP address, both of which may constitute personally identifiable information.

This implementation contradicts the Skill's own guidance to exclude PII from logs. Because the logger may write to local files, centralized observability services, or third-party logging backends, the pattern can propagate sensitive information into systems with broader access and longer retention than the primary application database.

The generic object spread also makes future misuse likely: callers can unintentionally include authorization tokens, passwords, session identifiers, request bodies, or other secrets.

Attack Path

  1. An attacker submits a failed login attempt containing a targeted or attacker-controlled email address.
  2. The authentication handler reads the email from req.body.email and the source address from req.ip.
  3. Both values are passed to logSecurityEvent.
  4. The function expands the values into the log record without redaction.
  5. PII is stored locally or forwarded through the application's configured logging transport.
  6. A user, service, or compromised account with access to the logging system can retrieve the exposed data.

Impact Assessment

The issue does not itself grant execution privileges or application authorization. Its impact is unauth ...[truncated 314 chars]

Remediation
View remediation

Remediation Suggestions

  • Do not log raw email addresses or full IP addresses unless a documented security requirement makes them indispensable.
  • Replace the arbitrary ...details expansion with an explicit allowlist of approved fields.
  • Pseudonymize user identifiers using a keyed cryptographic hash when event correlation is required.
  • Truncate or otherwise anonymize IP addresses where full addresses are unnecessary.
  • Configure logger-level redaction for passwords, authorization headers, cookies, access and refresh tokens, session identifiers, and common PII fields.
  • Validate and normalize all security-event data before recording it.
  • Prohibit callers from passing request objects, response objects, request bodies, headers, or arbitrary nested objects.
  • Apply least-privilege access controls, encryption, retention limits, and audit trails to all log storage and aggregation systems.
  • Add automated tests verifying that sensitive fields cannot appear in serialized log records.

A safer design should accept a narrowly defined event schema rather than arbitrary details, for example:

javascript
function logSecurityEvent({ event, subjectIdHash, ipPrefix, path }) {
  logger.warn({
    type: 'security',
    event,
    subjectIdHash,
    ipPrefix,
    path,
    timestamp: new Date().toISOString()
  });
}
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

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 · SKILL.md (reported line 205)May include surrounding context.

md
**JWT security checklist:**
- [ ] Algorithm explicitly set (no `alg: "none"` accepted)
- [ ] Secret is at least 32 bytes for HMAC, or use RS256/ES256 with proper key management
- [ ] `exp` claim is set and enforced (max 15 minutes for access tokens)
- [ ] `iss` and `aud` claims validated
- [ ] Refresh token rotation implemented (one-time use)
- [ ] Token blacklist/revocation mechanism for logout

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 699)May include surrounding context.

md
| `SKILL.md` | This file -- complete hardening checklist with code examples |

Unbounded Output

Medium
Category
Output Handling
Confidence
75% confidence
Finding

Output size or generation rate is not bounded. Unbounded output enables denial-of-service through resource exhaustion, log flooding, or context-window stuffing.

Content

Scanner excerpt · SKILL.md (reported line 468)May include surrounding context.

md
### 8. Request Size Limits

**Why:** Without size limits, attackers can send massive payloads to exhaust server memory or cause denial of service.

**What to check:**
- Is the JSON body parser configured with a size limit?

Static analysis

No suspicious patterns detected.