T07 · Tool Hijacking and Spoofing
- Location
assets/sensitive-interaction.js:76- Finding
Untrusted Chat Content Can Spoof Sensitive-Data Controls and Trigger Message Submission
- Content
View full analysis
{ const sendButton = document.querySelector('button[type="submit"], [class*="send"], [part*="send"]'); if (sendButton) { sendButton.click(); } }, 100); } } ``` ```javascript // 自动检测:当新消息包含敏感检测结果时注入按钮 function observeNewMessages() { const observer = new MutationObserver((mutations) => { mutations.forEach(mutation => { if (mutation.addedNodes.length) { mutation.addedNodes.forEach(node => { if (node.nodeType === Node.ELEMENT_NODE) { // 检查节点和所有子节点内容 let content = node.textContent || ''; if (!content.includes('## 检测结果') || !content.includes('## 操作选项')) { // 检查 shadow DOM if (node.shadowRoot) { content = node.shadowRoot.textContent || ''; } } if (content.includes('## 检测结果') && content.includes('## 操作选项')) { // 保存最后敏感内容供编辑使用 const match = content.match(/原文: `(.*?)`/); if (match) { window.lastSensitiveContent = match[1]; } // 注入按钮到当前节点 injectSensitiveButtons(node, content); } } }); } }); }); ``` ### Technical Analysis The mutation observer treats any rendered eleme ...[truncated 2106 chars]- Remediation
View remediation
