T09 · Insecure Skill Coding Practices
- Location
SKILL.md:227- Finding
Sensitive Form Values Exposed Through Unrestricted Summary Logging
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 227–244
Vulnerability Type: Sensitive data exposure through insecure logging
Risk Level: MediumVulnerable Code
javascript // Show filled form summary to user const summary = await browser.evaluate(() => { const filled = [] document.querySelectorAll('input, select, textarea').forEach(el => { if (el.value) { filled.push({ label: el.placeholder || el.name || el.id, value: el.value }) } }) return filled }) // Ask user to confirm console.log("已填写的字段:") summary.forEach(item => { console.log(` ${item.label}: ${item.value}`) })Technical Analysis
The summary logic enumerates every populated
input,select, andtextareaon the page and returns its raw value from the browser context. It does not limit collection to controls filled by the skill and does not exclude sensitive control types such aspasswordorhidden.Consequently, the code may collect pre-existing credentials, anti-CSRF tokens, application secrets, identity information, and other values that were populated by the website, password manager, browser profile, or user. These values are then printed without masking, potentially placing them in agent output, browser automation logs, conversation history, or other retained telemetry.
This is an insecure coding practice rather than evidence of intentional exfiltration. No external transmission mechanism was identified in the audited files.
Attack Path
- A user invokes the skill on a web form while using an existing authenticated browser session.
- The page contains a populated sensitive control, such as a password field or hidden token. The value may originate from the site, a password manager, or prior user interaction.
- The summary routine executes
document.querySelectorAll('input, select, textarea'). - Because the sensitive control has a ...[truncated 1001 chars]
- Remediation
View remediation
Remediation Suggestions
- Maintain an explicit list of controls successfully modified by the skill and summarize only those controls.
- Exclude sensitive types, including
password,hidden, file, and payment-related fields. - Reject fields whose names, IDs, labels, or autocomplete attributes indicate secrets, tokens, credentials, payment data, or government identifiers.
- Mask values before display, such as partially redacting telephone numbers, email addresses, identity numbers, and addresses.
- Prefer a field-name-only confirmation summary where displaying the exact value is unnecessary.
- Avoid writing raw form values to console output or persistent logs.
- Require explicit confirmation before collecting or displaying highly sensitive information.
- Add tests demonstrating that pre-existing, hidden, password, token, and unrelated fields never appear in the summary.
