T09 · Insecure Skill Coding Practices
- Location
bin/run.mjs:211- Finding
API Credential Exposed Through URL Query String and Command-Line Arguments
- Content
View full analysis
item.location === "query")) { const value = params[parameter.name]; if (value === undefined) { continue; } appendValue(url.searchParams, parameter.name, value); } } ``` The documented invocation also supplies the credential as a command-line argument: ```bash node {baseDir}/bin/run.mjs --operation "searchZhihuV1" --token "$JUST_ONE_API_TOKEN" --params-json '{"keyword":""}' ``` ### Technical Analysis The operation manifest defines `token` as a query parameter. `injectToken()` copies the credential supplied through `--token` into the parameter object, after which `applyQueryParams()` serializes it into the request URL. The resulting request has the effective form: ```text https://api.justoneapi.com/api/zhihu/search/v1?token=&keyword=&offset=0 ``` HTTPS protects the request URL from passive network observers while it is in transit, and the destination is statically restricted to ...[truncated 2291 chars]- Remediation
View remediation
