T09 · Insecure Skill Coding Practices
- Location
index.html:594- Finding
Unrestricted iframe messaging exposes DOM content and user input to an untrusted parent
- Content
View full analysis
50 ? text.substring(0, 50) + "..." : text; } ``` Captured element information is transmitted to the parent window using the unrestricted wildcard target origin: ```javascript var elementInfo = { tagName: target.tagName.toLowerCase(), rect: { left: rect.left, top: rect.top, right: rect.right, bottom: rect.bottom, width: rect.width, height: rect.height, x: rect.x, y: rect.y }, selector: selector, text: text, attributes: attributes, url: window.location.href, path: window.location.pathname, timestamp: Date.now() }; try { window.parent.postMessage({ type: "iframe-element-hover", data: elementInfo, source: "iframe-highlight-injector" }, "*"); } catch (error) { console.warn("无法发送消息到父窗口:", error); } ``` The click handler performs the same unrestricted disclosure: ```javascript var elementInfo = { tagName: target.tagName.toLowerCase(), rect: { left: rect.left, top: rect.top, right: rect.right, bottom: rect.bottom, width: rect.width, height: rect.height, x: rect.x, y: rect.y }, selector: selector, text: text, attributes: attributes, url: window.location.href, path: window.location. ...[truncated 5559 chars]- Remediation
View remediation
