T03 · Remote Payload Retrieval and Execution
- Location
scripts/kg_builder.py:151- Finding
Generated Reports Execute Mutable Remote JavaScript
- Content
View full analysis
``` ### Technical Analysis The generated knowledge-graph report loads D3.js from a remote CDN whenever the HTML file is opened. Although HTTPS protects the connection in ordinary circumstances, the dependency is not bundled locally and the script element does not specify a Subresource Integrity hash. Consequently, the code that ultimately executes is not fixed at Skill review time. Compromise of the CDN, its publishing infrastructure, DNS resolution, or another trusted delivery component could cause arbitrary JavaScript to execute inside the generated report. This is best classified as `T03: Remote Payload Retrieval and Execution` because an external URL supplies executable code after the Skill package has been reviewed. ### Attack Path 1. A user or Agent invokes `scripts/kg_builder.py` and generates the knowledge-graph HTML report. 2. The user opens the generated report in a browser while network access is available. 3. The browser requests `https://d3js.org/d3.v7.min.js`. 4. An attacker who has compromised the upstream distribution channel returns modified JavaScript. 5. The browser executes that JavaScript in the generated report's context. 6. The malicious script can inspect or alter report content and perform network requests with the privileges available to browser JavaScript. ### Impact Assessment Successful exploitation provides arbitrary JavaScript execution in the browser context of the generated report. The attacker could: - Read and modify knowledge-graph data displayed by the report. - Falsify report content or user-interface elements. - Redirect the user or display deceptive prompts. - Send accessible report data to an external service. - Access other reso ...[truncated 291 chars]- Remediation
View remediation
``` 4. Define a restrictive Content Security Policy that permits scripts only from approved locations and prohibits inline or dynamically evaluated code where feasible. 5. Document that generated reports require an external dependency if the report cannot be made fully self-contained. ]]>
