T09 · Insecure Skill Coding Practices
- Location
references/scene2-nearby-search.md:73- Finding
API Key Exposure Through Shareable Query-String URLs
- Content
View full analysis
Vulnerability Details
File Location:
references/scene2-nearby-search.md:73,references/scene2-nearby-search.md:93-100,references/scene5-travel-planner.md:78, andreferences/scene5-travel-planner.md:123-142
Vulnerability Type: Sensitive credential exposure through URLs
Risk Level: HighVulnerable Code Snippets
references/scene2-nearby-search.md:73:text https://mapapi.qq.com/web/claw/nearby-search.html?center={纬度},{经度}&keyword={搜索类别}&radius=1000&key=xxxreferences/scene2-nearby-search.md:93-100:text 4. 拼接链接:`https://mapapi.qq.com/web/claw/nearby-search.html?keyword=美食&center=39.939385,116.353138&radius=1000&key=xxx` ### 回复模板📍 已查询到「{位置}」的坐标({纬度},{经度}),为你生成周边{搜索类别}的搜索链接:
text `references/scene5-travel-planner.md:78`: ```text https://mapapi.qq.com/web/claw/travel.html?spots={spots_json}&recommend={推荐类型}&key=xxxreferences/scene5-travel-planner.md:123-142:text https://mapapi.qq.com/web/claw/travel.html?&spots=[{"name":"故宫","lat":39.918,"lng":116.397},{"name":"颐和园","lat":39.999,"lng":116.275},{"name":"香山","lat":39.993,"lng":116.188},{"name":"环球影城","lat":39.843,"lng":116.681}]&recommend=restaurant,hotel&key=xxx https://mapapi.qq.com/web/claw/travel.html?spots=[{"name":"故宫","lat":39.918,"lng":116.397},{"name":"颐和园","lat":39.999,"lng":116.275},{"name":"香山","lat":39.993,"lng":116.188},{"name":"环球影城","lat":39.843,"lng":116.681}]&recommend=restaurant,hotel&key=xxxThe quoted snippets contain untranslated source placeholders because they reproduce the audited files verbatim.
Technical Analysis
The skill documentation directs the agent to substitute the user's Tencent Maps API key for
xxx, embed that credential in a query string, and return the resulting URL in a chat respons ...[truncated 2720 chars]- Remediation
View remediation
Remediation Suggestions
- Never place long-lived API keys in URLs returned to users, chat messages, Markdown links, or browser-visible query strings.
- Replace direct client-side key use with a trusted backend proxy. The proxy should retain the Tencent Maps credential server-side, validate requested operations, enforce parameter allowlists, and return only the required map data or a non-sensitive result identifier.
- If an interactive page requires authorization, issue a short-lived, single-purpose, scoped token rather than exposing the provider credential. Bind the token to the intended operation and expire it after first use or within a brief period.
- Configure logs, telemetry, and error-reporting systems to redact
key, token, and authorization parameters. Avoid logging complete request URLs. - Apply provider-side restrictions, including API allowlists, source restrictions where reliable, minimal quotas, anomaly alerts, and automatic rotation.
- Remove
key=xxxfrom all response templates and generated map URLs. Update the documentation to state explicitly that configured credentials must remain in server-side requests. - Return a safe application URL containing only an opaque result identifier. Store coordinates and itinerary data server-side when their disclosure is unnecessary.
- Revoke and rotate any key previously exposed through generated URLs. Review conversation, browser, proxy, and application logs for leaked historical values.
- Add automated tests or linting rules that reject response templates containing credential-like query parameters such as
key=,token=, orsecret=.
