Back to skill

Security audit

农历黄历吉凶查询 · 中国农历老黄历 · 每日宜忌择日

Security checks for vulnerabilities and agentic risk

Overview

This almanac skill needs review because its authentication code does not enforce the advertised secure destination for passwords and access tokens.

Request HTTPS/origin enforcement and safe redirect handling before supplying credentials. Keeping the default HTTPS endpoint does not by itself prevent token forwarding through redirects. Use a unique service password and keep printed tokens and passwords out of shared logs.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (5)

Tainted flow: 'req' from os.environ.get (line 42, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Sending credentials to the intended authentication API is legitimate, not inherently exfiltration. However, login and registration POSTs include plaintext password fields and use HUANGLI_BASE without validating its scheme or destination, so an attacker-influenced or mistakenly configured base can send credentials to an arbitrary server or over unencrypted HTTP.

Content

Scanner excerpt · scripts/auth.py (reported line 43)May include surrounding context.

python
def post_json(url, payload):
    body = json.dumps(payload).encode('utf-8')
    req = urllib.request.Request(url, data=body, method='POST', headers={'Content-Type': 'application/json'})
    with urllib.request.urlopen(req) as resp:
        return resp.getcode(), json.loads(resp.read())

Tainted flow: 'req' from os.environ.get (line 48, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
93% confidence
Finding

The status operation supplies HUANGLI_TOKEN in an Authorization header to a destination derived from unvalidated HUANGLI_BASE. An attacker who influences that configuration can receive the bearer token; additionally, urllib's default redirect handling can forward explicitly supplied Authorization headers to a different host.

Content

Scanner excerpt · scripts/auth.py (reported line 49)May include surrounding context.

python
def get_json(url, headers=None):
    req = urllib.request.Request(url, headers=headers or {})
    with urllib.request.urlopen(req) as resp:
        return resp.getcode(), json.loads(resp.read())

Tainted flow: 'req' from os.environ.get (line 50, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
93% confidence
Finding

The toolkit legitimately authenticates almanac requests, but it attaches HUANGLI_TOKEN to URLs built from an unrestricted HUANGLI_BASE. Configuration tampering or an HTTP base can expose the token, and default urllib redirect handling can also carry the Authorization header to a different host; this is a credential-destination validation weakness rather than evidence of intentional exfiltration.

Content

Scanner excerpt · scripts/toolkit.py (reported line 51)May include surrounding context.

python
data = json.dumps(payload).encode("utf-8")
        headers["Content-Type"] = "application/json"
    req = urllib.request.Request(url, method=method, data=data, headers=headers)
    with urllib.request.urlopen(req) as resp:
        return json.loads(resp.read())

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, network.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

The trigger list includes everyday date-selection phrases without requiring an almanac-related context.

Low
Category
Trigger Abuse
Confidence
95% confidence
Finding

The explicit triggers include “选日子” (choose a date) and “这一天好不好” (is this day good), which can occur in ordinary scheduling conversations unrelated to auspicious-day selection. Although grouped under an almanac heading, these phrases have no explicit contextual restriction or exclusion examples to prevent unintended activation.

Content

No source excerpt is available for this finding.