T09 · Insecure Skill Coding Practices
- Location
references/posts.md:82- Finding
Mutating Raw Curl Workflow Bypasses the Enforced User-Approval Gate
- Content
View full analysis
Vulnerability Details
File Location:
references/posts.md, lines 82–87
Vulnerability Type: Missing technical enforcement of approval for a destructive API operation
Risk Level: MediumVulnerable Code
bash # publish now curl -sS -X POST https://api-app.postnext.io/api/posts/publish \ -H "x-api-key: $POSTNEXT_API_KEY" -H 'Content-Type: application/json' \ -d '{"providers":{"twitter":{"channelName":"@brand","providerId":"tw_123", "content":{"text":"hi","media":[{"url":"https://cdn/x.png","type":"IMAGE"}]}}}}'Technical Analysis
The Skill requires publishing, scheduling, cancellation, deletion, and upload operations to be previewed and explicitly approved. The bundled
postnexthelper enforces this requirement with an operation-bound confirmation code. However, the Skill also permitsBash(curl:*)and presents raw curl as a supported alternative when the helper is unavailable.The documented command above directly sends an authenticated request to
/api/posts/publish. It contains no confirmation parameter, approval token, dry-run mode, or other technical mechanism binding the exact provider, channel, text, and media to prior user approval.Consequently, the raw-curl execution path bypasses the helper's confirmation gate. A textual instruction elsewhere in the documentation to obtain approval does not technically prevent an Agent from immediately executing this command.
Attack Path
- The user requests that the Agent draft or prepare a social-media post.
- The Agent follows the documented raw-curl workflow rather than invoking the gated
postnexthelper. - The Agent constructs a request body containing the selected provider, account identifier, post text, and media.
- Before obtaining explicit approval for that exact content, the Agent executes the documented authenticated
POST /api/posts/publishrequest. - PostNext accepts the request under
POSTNEXT_API_KEYand publishes the content to the connected ...[truncated 702 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove mutating raw-curl recipes from Agent-executable instructions and require all publish, schedule, cancel, delete, and upload operations to use the gated
postnexthelper. - Remove or narrow
Bash(curl:*)fromallowed-toolsif direct authenticated API calls are not essential. - If raw curl must remain supported, add a separate approval helper that:
- Produces a canonical preview of the exact operation.
- Hashes the provider, channel, content, media, schedule, and target identifier.
- Issues a short-lived, operation-bound confirmation token.
- Refuses to generate or execute the mutating curl command unless that token matches.
- Keep read-only curl examples separate from mutating examples so an Agent cannot mistake a direct publishing command for a safe preparation step.
- Add tests covering the raw API workflow and verify that no account-changing request can be sent before approval of the exact operation.
- Remove mutating raw-curl recipes from Agent-executable instructions and require all publish, schedule, cancel, delete, and upload operations to use the gated
