Skip to content

acl: use hostspec parser to disallow suffix hostname matches - #628

Merged
rofl0r merged 3 commits into
tinyproxy:masterfrom
rofl0r:acl_apex
Sep 15, 2026
Merged

rofl0r merged 3 commits into
tinyproxy:masterfrom
rofl0r:acl_apex

Conversation

@rofl0r

@rofl0r rofl0r commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

No description provided.

the documented intent is that a .foo.com hostspec matches
foo.com and anything ending in .foo.com; the former was
silently wrong.
the existing ad-hoc parsing in acl.c allowed an attacker to
use e.g. an "untrusted.net" domain name to access a reachable
tinyproxy instance if it had an allow list entry for "trusted.net".

exploiting it would require that the attacker has prior knowledge
of the instance's configuration or is damn good at guessing and
well-budgeted to register lots of potentially matching domains.

fix by re-using the existing hardened hostspec parser.

closes tinyproxy#627

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Update the public ACL documentation to explain exact and leading-dot subdomain matching.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Updates ACL hostname matching to use boundary-aware hostspec parsing, preventing suffix-collision matches.

Changes:

  • Adds exact and label-boundary hostname matching.
  • Reuses hostspec_match for ACL reverse-DNS checks.
  • Clarifies the changed apex-versus-subdomain semantics in the review notes.
File summaries
File Summary
src/hostspec.c Implements exact and label-boundary hostname matching.
src/acl.c Applies shared matching to ACL hostname checks; documentation should explain the new semantics.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/acl.c
@rofl0r
rofl0r merged commit 52d62a6 into tinyproxy:master Sep 15, 2026
4 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