Conversation
Greptile SummaryThis PR adds
Confidence Score: 4/5Safe to merge; the javascript: href concern is low-likelihood but worth a one-line fix before shipping. All findings are P2. The unvalidated href is a supply-chain-dependent security pattern worth addressing, but the source (en.dev) is the same org, making exploitation unlikely in practice. No logic errors or P0/P1 issues were found. docs/.vitepress/theme/EndevSponsors.vue — URL validation in the filter and v-for key choice.
|
| Filename | Overview |
|---|---|
| docs/.vitepress/theme/EndevSponsors.vue | New component; fetches and renders sponsor logos from an external JSON feed. Two P2 findings: unvalidated javascript: URLs from the feed used as anchor href, and non-unique v-for key on sponsor.name. |
| docs/.vitepress/theme/index.ts | Adds EndevSponsors import and inserts it before EndevFooter in the layout-bottom slot array — straightforward, no issues. |
Reviews (1): Last reviewed commit: "add sponsor feed to docs" | Re-trigger Greptile
| .filter((sponsor) => | ||
| sponsor?.kind !== "infrastructure" && | ||
| sponsor?.name && | ||
| sponsor?.url && | ||
| sponsor?.logo | ||
| ); |
There was a problem hiding this comment.
Unvalidated
javascript: URL from external feed
sponsor.url is fetched from https://en.dev/sponsors.json and bound directly to :href. Vue does not strip the javascript: protocol from anchor bindings, so a compromised or manipulated sponsors.json payload could deliver a javascript: URL that executes arbitrary code when a visitor clicks a sponsor logo. Adding a protocol check to the existing filter is a minimal fix.
| <div class="EndevSponsorsLogos"> | ||
| <a | ||
| v-for="sponsor in sponsors" | ||
| :key="sponsor.name" |
There was a problem hiding this comment.
sponsor.name is not a reliable v-for key
Names are not guaranteed to be unique across sponsors, and Vue will warn (and may misreconcile the virtual DOM) on duplicate keys. Since sponsor.url is already validated as present by the filter and is inherently unique per sponsor, prefer using it as the key instead of sponsor.name.
Summary
Adds an en.dev company sponsor block to the docs footer.
Changes
EndevSponsors.vue, which fetcheshttps://en.dev/sponsors.jsonclient-side.sponsorslist, which is paid company sponsors only.Validation
npm install --no-package-lock --ignore-scriptsindocs/npm run docs:buildindocs/Note
Low Risk
Low risk docs-theme UI change; main impact is an additional client-side fetch to
https://en.dev/sponsors.jsonthat could fail or add minor latency, but it degrades gracefully by rendering nothing.Overview
Adds a new
EndevSponsorsblock to the VitePress docs theme that fetcheshttps://en.dev/sponsors.jsonon mount and renders a “Company sponsors” logo strip plus a “Sponsor the work” CTA when data is available.Updates the theme
Layoutto renderEndevSponsorsabove the existingEndevFooter, filtering outinfrastructureentries and ignoring invalid sponsor records.Reviewed by Cursor Bugbot for commit 79e977e. Bugbot is set up for automated code reviews on this repo. Configure here.