Skip to content

Commit 36bcc22

Browse files
kyalabsclaude
andauthored
fix(deps): patch picomatch CVEs (#28)
* refactor: extract isPublicOrigin() to shared url-safety module SSRF protection was defined locally in ucp-manifest.ts. Extract to src/lib/url-safety.ts so kya_web_fetch and future outbound fetch tools can reuse it. Zero functional change — import replaces inline. Adds 16 tests covering RFC1918, localhost, IPv6 private, link-local, AWS metadata (169.254.x), and malformed URL cases. Part of: KYA-55 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add kya_getHeaders tool for browser automation identity Returns { headers: { "Kya-Token": token } } for agents using Playwright (setExtraHTTPHeaders) or Chrome extensions (document.cookie). Returns NO_IDENTITY error when no identity established. Part of: KYA-55 (Path 2/2.5 identity delivery) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add kya_web_fetch tool with auto-declare and SSRF protection Primary identity delivery path. Wraps fetch with: - Kya-Token header auto-injection - Auto-declare (browse_declared event, fire-and-forget) - SSRF protection via isPublicOrigin() - HTTPS-only, 5MB body cap, 30s timeout - Manual redirects (prevents token leak to redirect targets) - Method allowlist: GET, HEAD, OPTIONS - Response header filtering (strips set-cookie) 29 tests covering identity, URL validation, SSRF, methods, fetch behavior, truncation, timeouts, auto-declare, and header override prevention. Part of: KYA-55 (Path 1 identity delivery) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: register new tools + deprecate legacy reporting Register kya_web_fetch and kya_getHeaders in index.ts. Deprecate kya_reportBadgeOutcome and kya_reportBadgeNotPresented to no-ops — outcomes tracked server-side via verify endpoint, not-presented event no longer scored. Both log once-per-session stderr warning. Remove unused imports. Update kya_reportBadgePresented description to stop referencing the now-deprecated kya_reportBadgeOutcome. Part of: KYA-55 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: bump to v2.5.0 + CHANGELOG for identity delivery Version 2.4.0 → 2.5.0 (minor: new tools, deprecations, no breaking changes). CHANGELOG documents kya_web_fetch, kya_getHeaders, deprecations. .gitignore adds .env patterns. Part of: KYA-55 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: credential bridge — inject kya_* badge token, not consent key (KYA-98) The #1 E2E blocker. getHeaders() and webFetch() were injecting the consent key (pk_* / OAuth token) as Kya-Token header. The verify endpoint expects kya_* opaque tokens from /api/badge/enroll. Fix: - New module badge-token.ts: per-merchant badge token cache + enroll API - getAgentIdentity: calls enroll after identity established (fire-and-forget) - webFetch: looks up cached badge token by merchant, enrolls on-the-fly if needed - getHeaders: reads from badge token cache (last enrolled merchant) Also updates NEXT_STEP_TEXT to reference 2.0 tools (KYA-105). 178 tests passing (10 new in badge-token.test.ts). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: send consent key as Bearer auth on enroll call (KYA-106 compat) Enroll endpoint now requires auth. badge-token.ts must send the consent key as Authorization: Bearer header when calling enroll. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address CodeRabbit review findings on KYA-55 - Filter case-variant kya-token headers before spreading in webFetch so agents can't override the server-injected Kya-Token (Badge #6) - Update lastEnrolledMerchant on cache hit in getCachedBadgeToken so no-arg getHeaders() returns the correct merchant context (Badge #11) 178/178 tests passing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(deps): patch picomatch CVEs (GHSA-c2c7-rcm5-vvqj, GHSA-3v7f-55p6-f55p) npm audit fix — upgrades picomatch transitive dep to patched version. ReDoS via extglob quantifiers + method injection in POSIX character classes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Marty CPO <james@kyalabs.io> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7a333ac commit 36bcc22

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)