T09 · Insecure Skill Coding Practices
- Location
scripts/api.py:98- Finding
Cleartext HTTP Transport Exposes Uploaded Documents and API Credentials
- Content
View full analysis
Vulnerability Details
File Location:
scripts/api.py:98-116; insecure configuration examples also appear inscripts/config.json:2,SKILL.md:73-81, andSKILL_zh.md:73-82
Vulnerability Type: Sensitive information transmitted over cleartext transport
Risk Level: HighVulnerable Code
scripts/api.py:98-116:python headers = { "Authorization": f"Bearer {anyparse_api_key}" } url = f"{anyparse_api_url}" args = { "use_doc_cls": use_doc_cls, "use_doc_rectifier": use_doc_rectifier, "use_doc_layout": use_doc_layout, } files = { 'file': open(f"{filepath}",'rb') } res = rq.post(url, files = files, data = args, headers = headers) return res.json()scripts/config.json:1-4:json { "anyparse_api_url": "http://your-api-host:port/anyparse/invoke/v1", "anyparse_api_key": "your-api-key" }SKILL.md:73-81:json { "anyparse_api_url": "http://your-api-host:port/anyparse/invoke/v1", "anyparse_api_key": "your-api-key-here" }bash export anyparse_api_url=http://your-api-host:port/anyparse/invoke/v1Technical Analysis
The script uploads the complete user-selected document and sends the API credential in an
Authorization: Bearerheader to the configured URL. It does not validate the URL scheme or reject remote cleartext HTTP endpoints. The bundled configuration and documentation explicitly demonstrate anhttp://endpoint, making insecure deployment likely.When HTTP is used, neither the bearer credential nor the multipart document upload receives transport confidentiality or endpoint authentication. A network-positioned attacker can observe the request, recover the API key and document, modify uploaded data, or substitute the API response. The problem does not apply when a correctly valida ...[truncated 1164 chars]
- Remediation
View remediation
Remediation Suggestions
- Require
https://for all non-loopback API endpoints and reject unsupported or cleartext schemes before opening the document. - Permit HTTP only through an explicit opt-in intended for trusted loopback or isolated private deployments, accompanied by a prominent warning.
- Replace all
http://examples inconfig.json,SKILL.md, andSKILL_zh.mdwithhttps://. - Retain TLS certificate verification and do not introduce
verify=False. - Consider restricting the endpoint to an administrator-approved hostname allowlist to reduce accidental document disclosure to an unintended server.
- Use narrowly scoped, revocable API keys and rotate any key that may previously have been transmitted over HTTP.
- Open the file through a context manager so it is reliably closed after the request.
- Require
