T09 · Insecure Skill Coding Practices
- Location
SKILL.md:157- Finding
Automatic Acceptance of Legal Terms Uses an Overbroad Checkbox Match
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 157–170
Vulnerability Type: Unsafe automated consent and ambiguous element selection
Risk Level: MediumVulnerable Code
javascript (() => { const checkboxes = [...document.querySelectorAll('input[type="checkbox"]')]; const terms = checkboxes.find(cb => { const label = cb.closest('label') || document.querySelector('label[for="' + cb.id + '"]'); return label && /terms|conditions|policy|agree/i.test(label.textContent); }); if (terms && !terms.checked) { terms.click(); return 'checked terms'; } if (terms && terms.checked) return 'already checked'; return 'not found'; })()Technical Analysis
The skill automatically checks a legally significant checkbox without requiring the agent to display the exact consent text or obtain explicit user approval. Selection is based on the first checkbox whose label contains any broad keyword such as
policyoragree.This logic does not establish that the selected control is the required reservation-terms checkbox. A page containing multiple matching controls could cause the code to select a privacy preference, marketing consent, cancellation-policy acknowledgment, or another unrelated agreement. The later snapshot verifies only that a checkbox was checked, not that the intended agreement was selected.
The same vulnerable pattern is duplicated in
browser-snippets.md, lines 47–58.Attack Path
- The authenticated browser reaches an OpenTable checkout page.
- The legitimate page, third-party page content, or injected content introduces a checkbox before the intended terms checkbox.
- Its label contains one of the broad matching words, such as “policy,” “agree,” or “accept.”
- The snippet uses
Array.find()and selects the first matching checkbox. - The code invokes
.click()and records consent without showing the exact label to the user. - The agent proceeds to submit the reservation.
Impact
...[truncated 497 chars]
- Remediation
View remediation
Remediation Suggestions
- Display the complete checkbox label and relevant linked terms to the user before changing its state.
- Require explicit user confirmation before accepting legal or contractual terms.
- Replace broad keyword matching with a unique, verified selector or exact normalized label expected for the current OpenTable flow.
- Restrict matching to visible, enabled, required controls located inside the verified reservation form.
- Abort if zero or multiple candidate checkboxes are found.
- After selection, report the exact label and verify that the intended control—not merely any checkbox—is checked.
- Apply the same correction to the duplicate snippet in
browser-snippets.md, lines 47–58.
