T09 · Insecure Skill Coding Practices
- Location
scripts/module_assembler.py:170- Finding
QR Code Content Is Disclosed to an Undeclared External Service
- Content
View full analysis
str: """生成二维码组件HTML""" content = comp.get("content", "") size = comp.get("size", "120px") label = comp.get("label", "") # 使用QR码API生成 qr_url = f"https://api.qrserver.com/v1/create-qr-code/?size={size}x{size}&data={_esc(content)}" html = f'' ``` ### Technical Analysis The QR component embeds user-provided QR content directly into a URL hosted by `api.qrserver.com`. When the generated HTML is opened, the browser requests this URL and transmits the QR content to that third-party service. This behavior conflicts with the project's permission declarations in `SKILL.md` and `references/permissions.md`, which state that the Skill does not send data over the network and has no external network dependency. Although the Python process does not itself make the request, it deliberately generates HTML that causes a browser-side network request. The `_esc()` function performs HTML escaping, not URL query-component encoding. It therefore does not provide suitable handling for arbitrary query data. More importantly, escaping does not prevent disclosure because the QR content remains part of the outbound request URL. ### Attack Path 1. A user supplies a QR component whose `content` contains a private URL, invitation token, identifier, or other sensitive value. 2. `_gen_qrcode()` places that value into the `data` query parameter of an `api.qrserver.com` URL. 3. The generated HTML contains the remote URL as an image source. 4. The user opens the generated HTML in a browser. 5. The browser sends the QR content to `api. ...[truncated 667 chars]
- Remediation
View remediation
