Skip to content

Fix allowlist to honor IP addresses and CIDR ranges#78

Draft
ACK-J wants to merge 3 commits into
mainfrom
cursor/ip-whitelist-fix-371f
Draft

Fix allowlist to honor IP addresses and CIDR ranges#78
ACK-J wants to merge 3 commits into
mainfrom
cursor/ip-whitelist-fix-371f

Conversation

@ACK-J

@ACK-J ACK-J commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #66 and #64 by making IP address and CIDR allowlist entries actually take effect.

Also fixes a follow-up issue where whitelisting 127.0.0.1 did not stop TestPortScans.html from being blocked.

Problem

Solution

  • IP entries without a port match the same address on any port
  • CIDR ranges match IPv4 and IPv6 origins/destinations
  • localhost is treated as equivalent to 127.0.0.1
  • Domain entries still only match the page origin (e.g. discord.com)
  • IP and CIDR entries match both the page origin and local/private request destinations

Example

Page origin Scan target Allowlist Result
file:// (empty host) 127.0.0.1:80 127.0.0.1 Allowed
localhost 127.0.0.1:80 127.0.0.1 Allowed
evil.com 127.0.0.1:80 127.0.0.1 Allowed
evil.com 10.0.0.1:80 127.0.0.1 Blocked
evil.com 127.0.0.1:80 discord.com Blocked
discord.com 127.0.0.1:80 discord.com Allowed

Test plan

  • Verified matching logic for origins, destinations, localhost, CIDR, and domains
  • Add 127.0.0.1 to allowlist, open TestPortScans.html from disk, confirm 127.0.0.1 scans are not blocked
  • Add LAN CIDR (e.g. 192.168.1.0/24) and confirm Proxmox shell/console connections work
  • Confirm discord.com allowlist still only applies to pages on discord.com, not all scans to local IPs
Open in Web Open in Cursor 

cursoragent and others added 2 commits July 11, 2026 04:37
IP addresses could be added to the allowlist but were never matched because
origin hosts include ports (e.g. 127.0.0.1:8080) while entries were stored
without them. Add host matching that treats portless IP entries as matching
any port on the same address, and update settings UI to document IP support.

Fixes #66

Co-authored-by: Hacks and Hops <ACK-J@users.noreply.github.com>
Extend allowlist matching so entries like 192.168.1.0/24 match any origin
IP within the range. This supports homelab setups such as Proxmox web UIs
that need to make local network requests without disabling the extension.

Also centralize allowlist entry normalization in hostUtils.js.

Fixes #64

Co-authored-by: Hacks and Hops <ACK-J@users.noreply.github.com>
@cursor cursor Bot changed the title Fix allowlist to honor IP address entries Fix allowlist to honor IP addresses and CIDR ranges Jul 11, 2026
The allowlist only checked the page origin, so whitelisting 127.0.0.1 did
not help TestPortScans.html opened from file:// or localhost. IP and CIDR
entries now also match local/private request targets. localhost is treated
as equivalent to 127.0.0.1 for matching.

Co-authored-by: Hacks and Hops <ACK-J@users.noreply.github.com>
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.

[Feature Request] Expand "domain" whitelist to be able to include IP addresses

2 participants