Repository navigation
Harden API + fix bugs (v3.1) - #7
Merged
Merged
Conversation
Security:
- SSRF guards in api/chunk.js: http/https only, DNS-resolve + reject
private/reserved IP ranges (incl. 169.254 metadata, CGNAT, IPv6 ULA),
per-hop redirect re-validation, 5MB body cap, content-type allowlist
- escapeHtml now escapes quotes — closes title="${fragment}" attribute
XSS from scraped heading ids
- Slack mrkdwn escaping in feedback.js kills <!channel> pings + link
spoofing; pageUrl scheme-checked and length-capped
- Input validation with allowlists (400 not 500); error details no longer
leak to clients
Bugs:
- Overlap slider was permanently stuck on Auto (unreachable else branch)
- Dead node-fetch timeout replaced with native fetch + AbortSignal.timeout;
node-fetch dependency removed
- extract=defuddle now fails 422 instead of silently falling back to cheerio
Housekeeping:
- Removed scripts/build.js + vercel buildCommand; GTM-4G43 (shared SI
container, matches grader/ontologizer) hardcoded; GTM_SETUP.md rewritten
- Deleted ~1,900 lines of unused root design-system files
- README: MIT license, searchinfluence/getchunks URLs, v3/v3.1 history,
honest data-security FAQ
Verified locally: SSRF/scheme/validation rejections, live extraction,
http->https redirect following, slider fix, and XSS containment.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #6, which GitHub auto-closed when its stacked base branch (
feature/si-design-system, now merged via #5) was deleted. Identical content, retargeted tomain.Security
api/chunk.js): http/https only; DNS-resolve the host and reject private/reserved ranges (127/10/172.16/192.168, 169.254 metadata, 100.64 CGNAT, IPv6 loopback/ULA/link-local); every redirect hop re-validated (manual redirect, max 5); 5MB response cap; content-type allowlist.escapeHtmlnow escapes"and'— closes thetitle="${fragment}"attribute injection from scraped heading ids.api/feedback.js): escape&<>in message/email/pageUrl/user-agent; pageUrl must be http(s), length-capped.error.message.Bugs
timeout:; replaced with native fetch +AbortSignal.timeout(25s), node-fetch dependency removed.extract=defuddlenow fails 422 instead of silently falling back to cheerio.Housekeeping
scripts/build.js+ vercelbuildCommand;GTM-4G43hardcoded (shared SI container).Rate limiting — done separately
Two Vercel Firewall rules are already live on the project (
/api/chunk20/60s/IP,/api/feedback5/600s/IP, deny-on-exceed). Applied via the Firewall API; no code in this PR.Testing
Local harness + Playwright: SSRF/scheme/validation rejections, live extraction, http→https redirect following, slider fix (25→request), XSS containment.
🤖 Generated with Claude Code