T09 · Insecure Skill Coding Practices
- Location
SKILL.md:71- Finding
Indefinitely Cached Cost Verification Can Authorize a Chargeable Image Request
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 71–101
Vulnerability Type: Stale authorization and cost-verification reuse
Risk Level: MediumRelevant snippets:
text For a later request, reuse the verified profile indefinitely when the operation type, model, dimensions, Steps, image count, sampler/scale/noise, and other billing-affecting fields remain unchanged. A prompt change alone may reuse it when the provider does not price prompt text separately. Do not call the account or estimator tools again for a matching request; briefly state that the verified zero-Anlas profile is being reused.text `generate_image` is allowed only when a matching lease exists or a fresh gate satisfies **all** conditions below:text When a later request matches a valid lease, do not narrate another account check or estimator call. Reuse the verified profile and call only the one allowed image tool.Technical Analysis
The Skill permits a previous zero-Anlas estimate and account check to be cached indefinitely within a conversation. For matching local parameters, it explicitly instructs the agent not to query the account or cost estimator again and to invoke
generate_imagedirectly.This treats a historical remote-service response as current spending authorization. Matching request parameters do not prove that mutable external conditions remain unchanged. Account entitlement, service pricing, model behavior, usage-limit status, and whether prompt text affects pricing can change after the original verification.
The cached lease therefore bypasses the fresh cost check that protects the user's zero-Anlas authorization boundary. It also conflicts with the earlier hard-policy requirement in
SKILL.mdthat an estimate be obtained before every image generation.Attack Path
- An initial image request passes the account check and receives an explicit zero-Anlas estimate.
- The Skill st ...[truncated 1056 chars]
- Remediation
View remediation
Remediation Suggestions
- Call
estimate_anlas_costwith the exact final parameters immediately before every invocation ofgenerate_image. - Recheck the account entitlement before generation when the provider does not supply an atomic, provider-backed zero-cost authorization.
- Remove the instruction to reuse a verified billing profile indefinitely.
- If caching is necessary, use a short-lived lease issued or validated by the provider, bound to the account, model version, exact billing-affecting parameters, pricing revision, and entitlement state.
- Invalidate cached verification on any pricing or model-version change, account-state change, usage warning, provider reconnect, or inability to prove freshness.
- Fail closed when freshness cannot be established: do not call
generate_image. - Retain post-operation auditing as a secondary safeguard, but do not use it as a substitute for current pre-operation authorization.
- Call
