T09 · Insecure Skill Coding Practices
- Location
scripts/check_required_fields.js:103- Finding
Required Form Values Are Disclosed to the Agent and Command Output
- Content
View full analysis
{ if (el.getAttribute("aria-hidden") === "true") return; if (el.getAttribute("role") === "combobox" && el.getAttribute("aria-autocomplete") === "list") return; const tag = el.tagName; const type = (el.type || "").toLowerCase(); let filled = false; let value = null; if (type === "checkbox" || type === "radio") { filled = el.checked; value = el.checked ? (el.value || "checked") : null; } else if (tag === "SELECT") { const opt = el.options[el.selectedIndex]; value = opt ? opt.text.trim() : null; filled = !!value && value !== ""; } else if (tag === "INPUT" || tag === "TEXTAREA") { value = el.value.trim() || null; filled = !!value; } else if (tag === "DIV" || tag === "SPAN") { const text = (el.innerText || el.textContent || "").trim(); filled = text !== "" && !/attach|upload/i.test(text); value = filled ? text : null; } fields.push({ label: getLabel(el), tag, type: el.type || null, kind: "native", filled, value }); }); // 2. Custom combobox (framework-agnostic) document.querySelectorAll("input[role=\"combobox\"][aria-autocomplete=\"list\"]").forEach(combobox => { if (combobox.getAttribute("aria-required") !== "true") return; const isInvalid = combobox.getAttribute("aria-invalid") === "true"; // Try three methods in order to get the selected value const value = getSentinelValue(combobox) || getAriaSelectedValues(combobox) || getDisplayedValue(combobox) || null; const filled = !!value && !isInvalid; fields.push({ label: getLabel(combobox), tag: "INPUT", type: "combobox", kind: "combobox", id: combobox.id, filled, value }); }); // 3. Return grouped results: unfilled (needs input) a ...[truncated 2913 chars]- Remediation
View remediation
0; } ``` 5. Return only sanitized metadata: ```javascript fields.push({ label: getLabel(el), tag, type: el.type || null, kind: "native", filled }); ``` 6. Add automated tests proving that known secret marker values never appear in serialized evaluation output. 7. Avoid logging raw browser-evaluation output when it may contain application data. ]]>
