T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/blog-publish.py:39- Finding
Unnecessary Discovery and Loading of Authentication Secrets
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This blog publishing skill mostly does what it says, but its helper script unnecessarily reads credential-like values even though the API is documented as unauthenticated.
Install only if you are comfortable with a blog API management tool that can create, update, upload, and delete content on the configured server. Before use, verify BLOG_PUBLISH_BASE_URL points to the intended host, avoid placing BLOG_PUBLISH_* secrets in the environment or .project-info, and treat --hard deletion and file uploads as irreversible or externally visible actions.
scripts/blog-publish.py:39Unnecessary Discovery and Loading of Authentication Secrets
requirements.txt:1Unbounded and Unhashed Third-Party Dependency
Referenced artifact was not completely inspected
python3 scripts/blog-publish.py health-check
Referenced artifact was not completely inspected
python3 scripts/blog-publish.py health-check
Referenced artifact was not completely inspected
python3 scripts/blog-publish.py health-check
Referenced artifact was not completely inspected
python3 scripts/blog-publish.py health-check
Referenced artifact was not completely inspected
python3 scripts/blog-publish.py health-check
Referenced artifact was not completely inspected
python3 scripts/blog-publish.py health-check
Referenced artifact was not completely inspected
python3 scripts/blog-publish.py health-check
Referenced artifact was not completely inspected
python3 scripts/blog-publish.py health-check
Referenced artifact was not completely inspected
python3 scripts/blog-publish.py health-check
Referenced artifact was not completely inspected
python3 scripts/blog-publish.py health-check
Referenced artifact was not completely inspected
python3 scripts/blog-publish.py health-check
Referenced artifact was not completely inspected
python3 scripts/blog-publish.py health-check
Referenced artifact was not completely inspected
python3 scripts/blog-publish.py health-check
Referenced artifact was not completely inspected
python3 scripts/blog-publish.py health-check
Referenced artifact was not completely inspected
python3 scripts/blog-publish.py health-check
Referenced artifact was not completely inspected
python3 scripts/blog-publish.py health-check
Referenced artifact was not completely inspected
python3 scripts/blog-publish.py health-check
The code iterates over all environment variables and extracts credential-like values based on naming patterns, despite the skill not requiring authentication. In an agent environment, broad env inspection is especially risky because tokens and secrets for unrelated systems may coexist in the same process, making this unnecessary secret harvesting behavior more dangerous than in a standalone CLI.
"""
creds = {}
creds.update(_load_from_project_knowledge())
for k, v in os.environ.items():
u = k.upper()
if u.startswith(_CRED_PREFIX):
if 'BASE_URL' in u:
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
def cmd_delete_article(args):
"""能力 F:删除文章(默认软删除,--hard 硬删除不可恢复)"""
# DELETE /api/articles/{id}?soft=true|false
soft = 'false' if args.hard else 'true'
return _api_request('DELETE', f'/api/articles/{args.id}', params={'soft': soft})
The skill invokes network access, environment-variable access, and local file reads, but it does not declare an explicit tool scope such as permissions or allowed-tools. That omission weakens containment and reviewability: an agent may use broader capabilities than a caller expects, including reading configuration from .project-info/ and transmitting content to a remote API.
The skill is designed to send data to an external service via curl and Python HTTP calls. In context this is expected functionality, but it is still a real exfiltration surface because the target base_url can be sourced from environment, project files, or user/context input, allowing content, metadata, and uploaded files to be transmitted to an arbitrary host if that value is malicious or misconfigured.
# curl
curl -s --max-time 30 {base_url}/health
# Expected: {"status":"ok","service":"blog-api","version":"1.0.0"}
This markdown file describes hard deletion of articles (soft=false) and file upload/list/delete operations, which can affect user data and system integrity. Although the hard delete is marked as unrecoverable, the document does not provide an explicit overall warning about destructive actions, uploaded file visibility, or privacy implications of exposing uploaded content through listing endpoints.
The skill advertises and configures itself as an unauthenticated public API client, but it still recursively reads .project-info JSON files and scans environment variables for credentials-like values. Even though those secrets are not currently sent as auth, this unnecessary secret discovery expands the skill’s access to local sensitive data and creates latent exfiltration risk if the code is later modified or if values are exposed through errors/logging.
The credential-loading comments and docstrings claim authentication handling and interactive credential input, but the implementation uses only base_url because auth type is set to none. This mismatch is dangerous because it normalizes unnecessary secret collection behavior and can mislead users or future maintainers into supplying sensitive credentials the tool does not need.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
if method == 'GET':
resp = requests.get(url, params=params, timeout=30, **auth_kwargs)
elif method == 'POST':
resp = requests.post(url, json=payload, files=files, timeout=30, **auth_kwargs)
elif method == 'PUT':
resp = requests.put(url, json=payload, files=files, timeout=30, **auth_kwargs)
elif method == 'PATCH':