T09 · Insecure Skill Coding Practices
- Location
scripts/yunexpress_shipping.py:84- Finding
YunExpress API credentials and shipment data are transmitted over plaintext HTTP
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill appears to be a real shipping helper, but it can send carrier credentials and parcel data over insecure or insufficiently restricted API destinations.
Install only with caution. Do not use production credentials unless you can ensure HTTPS and official carrier hosts, keep the generated env files private with restrictive permissions, and review every --execute action because it can change real carrier account or shipment state.
scripts/yunexpress_shipping.py:84YunExpress API credentials and shipment data are transmitted over plaintext HTTP
scripts/yunexpress_shipping.py:84Unrestricted configurable API destinations can receive carrier authentication material and shipment payloads
scripts/yanwen_shipping.py:49Yanwen tracking sends merchant and parcel identifiers over plaintext HTTP
scripts/yunexpress_shipping.py:131Carrier API responses are printed without comprehensive personal-data redaction
scripts/yunexpress_shipping.py:108Credential environment templates are created without enforcing restrictive file permissions
If the skill exposes additional write actions such as IOSS changes, subscription management, CPSC filings, or direct execution of state-changing YunExpress operations beyond what users are told, that is a material security and integrity issue. Hidden or under-described write capabilities can alter carrier account state, compliance settings, or shipment data under trusted merchant credentials.
If the skill exposes additional write actions such as IOSS changes, subscription management, CPSC filings, or direct execution of state-changing YunExpress operations beyond what users are told, that is a material security and integrity issue. Hidden or under-described write capabilities can alter carrier account state, compliance settings, or shipment data under trusted merchant credentials.
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
Use `--help` to list all supported operations. `post` prints a redacted preview for a write until `--execute` is present. It sends JSON with UTF-8, derives `Authorization: Basic` from `Base64(customer-code & API-secret)`, and never logs that token.
## Output rules
- Quote results: compare service code/name, total fee, currency, billable weight, tracking availability, goods type, and delivery days; label prices as a point-in-time API result.
- Shipment preview: include order count (maximum 10 per create request), destination, selected product code, weight/dimensions, declared goods, optional services, and validation errors. Do not display full street addresses, phone numbers, emails, or credentials in chat.
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
REDACT = {"address", "address2", "phone", "email", "taxnumber", "apitoken", "authorization", "labelbase64"}
def load_env(path):
values = dict(os.environ)
if not path.exists(): raise ValueError(f"Env file not found: {path}. Run init-env and keep it private.")
for line in path.read_text(encoding="utf-8").splitlines():
if "=" in line and not line.lstrip().startswith("#"):
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
REDACT = {"address", "address2", "phone", "email", "taxnumber", "apitoken", "authorization", "labelbase64"}
def load_env(path):
values = dict(os.environ)
if not path.exists(): raise ValueError(f"Env file not found: {path}. Run init-env and keep it private.")
for line in path.read_text(encoding="utf-8").splitlines():
if "=" in line and not line.lstrip().startswith("#"):
The skill declares access to secrets, local files, and networked carrier APIs but does not define an explicit tool/permission scope. That omission weakens containment and review because the skill can read env vars, write payload files, and make authenticated external requests without machine-readable restrictions on what tools are allowed.
The documented tracking base URL uses HTTP instead of HTTPS, creating cleartext transmission risk for requests that include tracking numbers and Authorization data. An attacker on the network path could observe or tamper with shipment lookups, exposing customer parcel information and potentially compromising the shipping account.
- Production order API: `https://open.yw56.com.cn/api/order`
- Test order API: `https://open-fat.yw56.com.cn/api/order`
- Tracking API: `http://api.track.yw56.com.cn/api/tracking`
Use this reference with `scripts/yanwen_shipping.py`. Yanwen order APIs use POST and UTF-8 JSON. Put `user_id`, `method`, `format=json`, millisecond `timestamp`, `version=V1.0`, and `sign` in the query string; send compact JSON as the body. The signature is lowercase MD5 of `apiToken + user_id + compact-data + format + method + timestamp + version + apiToken`. A normal successful response has `success: true` and `code: "0"`.
This section explicitly instructs clients to send up to 30 parcel numbers to an HTTP tracking URL with the shipping account in the Authorization header, which is a direct credential-and-PII exposure pattern. Because the endpoint can return final-mile carrier and checkpoint details, interception would leak operational and customer delivery data and may allow unauthorized querying if credentials are reused.
## Tracking and status
Track up to 30 Yanwen or final-mile numbers with `GET http://api.track.yw56.com.cn/api/tracking?nums=...` and the shipping account in `Authorization`. Responses can include Yanwen number, final-mile number/carrier, carrier site/contact, checkpoints, and layered status. Key final-mile checkpoints: `LM25` out for delivery, `LM30` ready for pickup, `LM40` delivered, `LM50` failed delivery, `LM90` returned. Package-level state 1 means no result, 2 label created, 3 in transit, 4 delivery in progress, 5 ready for pickup, 6 delivered, 7 tracking ended, 8 delivery failed, 9 exception, and 0 returned.
## Failure handling
The reference directs use of a tracking endpoint over plain HTTP while sending shipment identifiers and an Authorization credential, which exposes both metadata and credentials to interception or modification in transit. In a shipping skill, this is especially sensitive because tracking numbers, final-mile details, and account credentials can reveal customer logistics information and enable unauthorized access or tracking queries.
The code claims credentials are never printed, but output() and HTTP error handling can print carrier response bodies with only limited redaction. If the carrier echoes submitted data, authorization-related values, labels, addresses, or other sensitive fields under unexpected keys, those values may be exposed in logs or terminal output despite the safety claim.
This is a real security issue because the external transmission is to an unencrypted HTTP endpoint, not merely because data leaves the system. In this skill context, the transmission includes shipment identifiers and an Authorization header, so interception or tampering is feasible on hostile networks.
def track(env, numbers):
if not 1 <= len(numbers.split(",")) <= 30: raise ValueError("Track 1-30 comma-separated numbers.")
url = "http://api.track.yw56.com.cn/api/tracking?" + urlencode({"nums": numbers})
req = Request(url, headers={"Authorization": env["YANWEN_USER_ID"]}, method="GET")
with urlopen(req, timeout=45) as response: return response.status, json.loads(response.read().decode("utf-8"))
The tracking function sends requests to an HTTP endpoint instead of HTTPS while also attaching an Authorization header containing the Yanwen user ID. This allows network attackers or intermediaries to observe or modify tracking numbers, responses, and headers in transit, which is especially risky in a shipping skill handling merchant logistics data.
The tracking request uses plain HTTP with no warning to the operator, so package numbers and the Authorization header are transmitted without transport security. Users are not informed that a supposedly safe client is downgrading confidentiality and integrity for a logistics lookup.
Detected: suspicious.exposed_secret_literal