Skip to content

fix: adversarial town match, http(s) hrefs, and geolocation - #13

Merged
jacobyoby merged 1 commit into
mainfrom
cursor/fix-adversarial-findings-f863
Sep 18, 2026
Merged

jacobyoby merged 1 commit into
mainfrom
cursor/fix-adversarial-findings-f863

Conversation

@jacobyoby

@jacobyoby jacobyoby commented Sep 18, 2026 •

Copy link
Copy Markdown
Owner

Highest-value adversarial findings from the attached plan.

What changed

  • Town/ZIP: exact 5-digit ZIP; city match is normalized equality so Milford is Hunterdon, not New Milford, and Franklin is not Franklin Lakes. Generic/New/1/a/Main return null. Library-name fallback is word-boundary only, length ≥ 4.
  • hrefs: safeHttpUrl on website, legal-help evidence, and service evidence. Unsafe values (javascript:, parenthetical notes) are not links. Directory website links use the same helper.
  • Legal filter "no": directory option; unit + e2e assert confirmed-negative rows.
  • Geolocation: native Capacitor.Plugins.Geolocation when isNativePlatform(); otherwise navigator.geolocation, with ZIP/town on deny.
  • Tests: no APK existsSync. pretest still builds www/. New geolocation unit tests; directory e2e route-mocks a javascript: website.

Finder: Milford resolves to Hunterdon, not New Milford
Directory legal=no shows only no in the Legal help column
adversarial-milford-legal-no-demo.mp4

Test plan

  • npm test — 45 passing including Milford/Franklin/safeHttpUrl/legal=no/geolocation
  • npm run test:e2e — 9 passing including Milford finder, javascript: directory fixture, geo deny, legal=no

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

Town/ZIP matching is exact (normalized), so Milford is not New Milford.
Website and legal-help evidence become links only when they are http(s).
Native location uses the Capacitor Geolocation plugin; the browser path
still falls back to ZIP/town on deny. Tests cover those cases without
relying on a gitignored APK.

Co-authored-by: Jacobrakai <jacobyoby@users.noreply.github.com>
@jacobyoby
jacobyoby marked this pull request as ready for review September 18, 2026 22:21
@jacobyoby
jacobyoby merged commit 76bd33b into main Sep 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants