T08 · Insecure Dependencies
Note
- Location
- templates/dua-book-template.html:8
- Finding
- Remote Google Fonts Dependency Causes Metadata Disclosure and Supply-Chain Exposure<![CDATA[ ## Vulnerability Details **File Location**: `templates/dua-book-template.html:8` **Vulnerability Type**: Remote third-party stylesheet dependency **Risk Level**: Low ### Vulnerable Code ```css @import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Inter:wght@300;400;600;700&display=swap'); ``` ### Technical Analysis The HTML template imports a stylesheet from Google Fonts whenever the generated document is opened with network access. This creates an external dependency whose response and availability are outside the project's control. The request discloses network metadata to third-party infrastructure, including the user's IP address, user agent, request time, and potentially referrer information depending on browser policy. The browser may subsequently request font resources referenced by the returned stylesheet. Although the imported resource is CSS rather than directly executable JavaScript, remote stylesheets remain active browser content and can change after the skill package has been audited. This conflicts with the project's privacy-conscious and offline/printable design claims. No evidence was found that personal dua text, form contents, credentials, or local files are explicitly transmitted by the project code. ### Attack Path 1. The skill generates or distributes a dua book using `templates/dua-book-template.html`. 2. A user opens the generated HTML document in a browser while connected to the Internet. 3. The browser automatically requests the stylesheet from `fonts.googleapis.com`. 4. Google-controlled infrastructure receives the user's network and browser metadata. 5. The returned stylesheet directs the browser to retrieve associated font resources. 6. If the remote service, delivery path, or referenced content were compromised or changed, the rendered document would consume the modified remote content without local integrity verification. No user interaction beyond opening the HTML file is required fo ...[truncated 652 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Download and package the required Amiri and Inter font files with the project. 2. Replace the remote `@import` declaration with local `@font-face` declarations, for example: ```css @font-face { font-family: 'Amiri'; src: url('./fonts/amiri-regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; } @font-face { font-family: 'Inter'; src: url('./fonts/inter-regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; } ``` 3. Alternatively, remove the external dependency and use system font stacks. 4. Add a restrictive Content Security Policy to generated HTML, such as: ```html <meta http-equiv="Content-Security-Policy" content="default-src 'self'; style-src 'self' 'unsafe-inline'; font-src 'self'; script-src 'self' 'unsafe-inline'; connect-src 'none'; img-src 'self' data:;"> ``` 5. If remote fonts must remain, disclose the outbound request to users and configure an appropriate referrer policy. Self-hosting is preferable because Subresource Integrity is not straightforward for a dynamically generated Google Fonts stylesheet. 6. Test the completed artifact with network access disabled and verify that it remains fully functional and visually acceptable. ]]>
