T09 · Insecure Skill Coding Practices
- Location
zepto-agent.js:322- Finding
Unvalidated Adjacent UI References Can Trigger Unintended Browser Actions
- Content
View full analysis
`e${parseInt(num) + 1}`); ``` `zepto-ops.js:261-265`: ```js // Calculate ADD button ref (usually product ref + 1) const refNum = parseInt(product.ref.replace('e', '')); const addRef = `e${refNum + 1}`; // Click ADD await click(browserTool, targetId, addRef, 1000); ``` ### Technical Analysis Both implementations assume that the ADD button always has the browser reference immediately following the product reference. Browser references are transient identifiers generated from the current page structure; they are not stable semantic identifiers and do not guarantee adjacency. The parser already extracts a dedicated `addButtonRef` from standalone ADD controls, but the callers ignore this value and instead calculate a new reference arithmetically. If Zepto changes its DOM structure, inserts another interactive control, or serves a different layout, the inferred reference can identify an unrelated action. Verification in `zepto-ops.js` only checks whether the cart contains at least one item after the click. If the cart already changed for another reason, or the wrong control adds a different product, this condition can incorrectly report success. ### Attack Path 1. The user asks the skill to add a particular product. 2. Zepto returns search results in a layout where the element after the product reference is not its ADD button. 3. The parser identifies the product as reference `eN`. 4. The automation constructs `eN+1` without inspecting the referenced element's role, label, or product association. 5. The skill clicks the unrelated element. 6. The weak verification accepts any nonempty cart rather than confirming that the requested product and quantity were ad ...[truncated 557 chars]- Remediation
View remediation
