T08 · Insecure Dependencies
- Location
DESIGN_MOCKUPS/preview.html:7- Finding
Unpinned Third-Party Scripts Executed Without Integrity Verification
- Content
View full analysis
Vulnerability Details
File Location:
DESIGN_MOCKUPS/preview.html, lines 7–10
Vulnerability Type: Third-party supply-chain exposure through mutable CDN resources
Risk Level: Mediumhtml <script src="https://cdn.tailwindcss.com"></script> <script src="https://unpkg.com/react@18/umd/react.production.min.js"></script> <script src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script> <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>Technical Analysis
Opening the mockup causes the browser to download and execute four scripts from third-party CDNs. The Tailwind CSS and Babel URLs do not specify versions. The React URLs use the mutable major-version alias
@18rather than immutable, exact versions. None of the script elements provides a Subresource Integrity (integrity) hash.Consequently, the code executed by the page can change after the project has been audited. A compromised CDN, upstream package release, account, or delivery path could substitute hostile JavaScript. The browser would execute that code with the page's origin and browser privileges.
Attack Path
- An attacker compromises a referenced CDN, upstream package distribution account, or mutable resource associated with one of the URLs.
- The attacker replaces the expected library response with malicious JavaScript.
- A user opens
DESIGN_MOCKUPS/preview.htmlwhile network access is available. - The browser retrieves the altered resource because no immutable local artifact is used.
- The browser cannot verify the resource against an expected hash because no
integrityattribute is present. - The hostile script executes automatically in the page context.
Impact Assessment
Successful exploitation permits arbitrary client-side JavaScript execution in the mockup's context. The malicious dependency could falsify dashboard and affiliate information, redirect users to attacker-controlled destinations, issue network r ...[truncated 267 chars]
- Remediation
View remediation
Remediation Suggestions
- Install audited dependencies at exact versions and bundle them into local static assets.
- Commit and enforce a dependency lockfile, such as
package-lock.json, and use reproducible installation commands such asnpm ci. - Remove browser-side Babel and the Tailwind CDN runtime from production or distributable previews; compile JSX and CSS during the build.
- If CDN resources remain necessary, reference immutable exact-version URLs and add verified
integrityhashes withcrossorigin="anonymous". - Add a restrictive Content Security Policy that limits
script-src,style-src,font-src, andconnect-srcto explicitly required origins and avoids allowing unsafe inline or evaluated code. - Automate dependency vulnerability and integrity checks in CI, and review version updates before deployment.
