T09 · Insecure Skill Coding Practices
- Location
scripts/_common.py:80- Finding
Authentication Credentials Can Be Forwarded to a Different Origin During Redirects
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This HTTP toolkit is mostly what it claims to be, but it handles credentials and local files too broadly for agent use without enough warnings or safeguards.
Install only if you are comfortable with an agent making arbitrary HTTP requests and reading or writing user-specified local paths. Avoid using bearer tokens, basic auth, cookies, or sensitive files with untrusted URLs, and prefer disabling redirects or manually verifying redirect targets before sending credentials.
scripts/_common.py:80Authentication Credentials Can Be Forwarded to a Different Origin During Redirects
scripts/_common.py:24Path Validation Allows Unrestricted Local File Reads and Overwrites
scripts/_common.py:107Unbounded Response Buffering and Gzip Decompression Enable Memory Exhaustion
scripts/serve.py:67Static File Server Can Expose Files Outside the Selected Directory Through Symlinks
The declared description is for a full local HTTP client and tiny server toolkit, but the supplied code chunk does not implement any of those behaviors. It only verifies that python3 exists in the environment and prints its version. This is a materially different primary purpose, so the description does not accurately represent the actual code chunk.
The declared description presents a general-purpose HTTP client plus tiny local server toolkit, emphasizing request methods (GET/POST/PUT/PATCH/DELETE), download/resume/checksum features, and running a local test server. The supplied code chunk does not implement a general HTTP toolkit or local server behavior. Instead, it is a specialized HTML extraction tool built on top of a GET fetch helper. Its primary purpose is fetching a webpage and parsing its contents into text, title, metadata, links, images, or tables. While some overlap exists with the declared HTTP-client aspects (GET request, retries, headers, bearer auth, redirect following likely via fetch), the dominant behavior shown here is undeclared content extraction/scraping, and several prominently declared capabilities are absent from this chunk. Therefore the description does not accurately represent what this code chunk actually does.
The declared description presents a combined HTTP client and server toolkit. However, this code chunk only provides a local HTTP server with two modes: static file serving and JSON echo. That server behavior is consistent with part of the description, but the major declared client-side capabilities are absent from the supplied code. Since the actual code’s scope is materially narrower than the declared purpose, the description does not accurately represent what this specific code chunk actually does.
The skill advertises capabilities that include network access and file read/write behavior, but the manifest does not declare any explicit tool scope or permissions boundaries. In an agent ecosystem, this weakens policy enforcement and can allow a seemingly simple skill to perform higher-risk actions without clear operator consent.
The skill explicitly supports authenticated HTTP requests and form/JSON submission to arbitrary endpoints, yet its documentation does not warn that tokens, credentials, and submitted data may be transmitted to remote services. In agent-driven workflows, this can lead to accidental exfiltration of secrets or sensitive user data to untrusted endpoints.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# Simple GET
python3 scripts/get.py https://api.example.com/users
# GET with auth, query params, JSON pretty-print
python3 scripts/get.py https://api.example.com/users \
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# Simple GET
python3 scripts/get.py https://api.example.com/users
# GET with auth, query params, JSON pretty-print
python3 scripts/get.py https://api.example.com/users \
This example shows authenticated requests using a bearer token to a remote endpoint, which normalizes sending secrets over the network without any adjacent safety warning. In an agent context, examples strongly influence behavior, and this can encourage operators or autonomous agents to transmit credentials to unintended or insufficiently trusted services.
python3 scripts/get.py https://api.example.com/users
# GET with auth, query params, JSON pretty-print
python3 scripts/get.py https://api.example.com/users \
--bearer "$TOKEN" \
--query 'limit=20' --query 'page=1' \
--json
This example demonstrates posting JSON data, including personal information and an authorization token, to a remote API without any cautionary note. That increases the risk of accidental disclosure of PII or credentials when the skill is used by agents that may follow examples literally.
python3 scripts/get.py https://example.com --status-only
# POST JSON
python3 scripts/post.py https://api.example.com/users \
--json '{"name":"Alice","email":"alice@example.com"}' \
--bearer "$TOKEN"
This code returns a JSON envelope containing all request headers and the parsed request body, which can include credentials, tokens, cookies, or other sensitive data sent by the client. Although the module docstring says echo mode is useful for inspecting what an agent is sending, it does not explicitly warn users that potentially sensitive request data will be captured and reflected.
The docstring states that there are no remote calls beyond what the user explicitly asks for. However, fetch() follows redirects by default via urllib unless follow_redirects is disabled, which can cause additional network requests to different URLs than the original user-provided target. This is a documentation-to-behavior mismatch in the file's stated intent.
Detected: suspicious.insecure_tls_verification