T09 · Insecure Skill Coding Practices
- Location
scripts/submit_wan_2_2_fast.sh:12- Finding
PoYo API Bearer Token Exposed in Process Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
scripts/submit_wan_2_2_fast.sh, lines 12-16
Vulnerability Type: API credential exposure through process arguments
Risk Level: MediumVulnerable Code
bash curl --fail-with-body --request POST \ --url "https://api.poyo.ai/api/generate/submit" \ --header "Authorization: Bearer ${POYO_API_KEY}" \ --header "Content-Type: application/json" \ --data @"${payload_file}"Technical Analysis
The shell expands
${POYO_API_KEY}before startingcurl, placing the complete bearer token in the process argument vector. While the request is running, local users or monitoring processes with sufficient permission may retrieve the command line through process inspection mechanisms such as/proc, process accounting, audit infrastructure, or process-monitoring utilities.The script otherwise sends the credential only to the declared HTTPS PoYo endpoint, and no hardcoded credential is present. Nevertheless, command-line placement unnecessarily increases exposure beyond the intended network request.
Exploitation requires local process-inspection access, elevated monitoring privileges, or compromised observability infrastructure. This issue does not independently provide remote code execution or operating-system privilege escalation.
Attack Path
- A user exports a valid
POYO_API_KEYand invokes the submission script. - The shell expands the environment variable into curl's
Authorizationheader argument. - While curl is running, an attacker with adequate local inspection permissions reads its argument vector or obtains it from process-monitoring or audit records.
- The attacker extracts the bearer token from the captured header.
- The attacker reuses the token to authenticate directly to the PoYo API.
- Requests are submitted under the victim's account until the credential is revoked, expires, or is otherwise restricted.
Impact Assessment
...[truncated 498 chars]
- A user exports a valid
- Remediation
View remediation
Remediation Suggestions
Avoid placing the bearer token directly in curl's command-line arguments.
- Supply the sensitive header through a protected curl configuration stream, anonymous file descriptor, or secure credential mechanism.
- Remove
POYO_API_KEYfrom curl's inherited environment after securely transferring it to the request configuration. - Disable shell tracing around credential-handling code and ensure process-monitoring systems do not record request headers.
- Use short-lived, narrowly scoped API keys where supported.
- Rotate the key if command lines may already have been captured.
- Preserve HTTPS certificate verification and the fixed approved API hostname.
One possible hardening pattern is to pass the authorization header through curl's standard-input configuration while removing the key from curl's inherited environment:
bash printf 'header = "Authorization: Bearer %s"\n' "$POYO_API_KEY" | env -u POYO_API_KEY curl --fail-with-body \ --config - \ --request POST \ --url "https://api.poyo.ai/api/generate/submit" \ --header "Content-Type: application/json" \ --data-binary @"${payload_file}"Confirm compatibility with the deployed curl version and prevent debug logs or shell tracing from recording the configuration stream.
