← 输入框|github.com|刷新
Skip to content

Distinguish BasicAuth challenges from failed authentication - #652

Merged
rofl0r merged 1 commit into
tinyproxy:masterfrom
MelfisDrake:fix/basic-auth-challenge-logging
Nov 23, 2026
Merged

rofl0r merged 1 commit into
tinyproxy:masterfrom
MelfisDrake:fix/basic-auth-challenge-logging

Conversation

@MelfisDrake

Copy link
Copy Markdown
Contributor

Fixes #651.

Requests without authentication headers currently produce the same Failed auth attempt log entry as requests with rejected credentials. Normal Basic authentication challenge/retry exchanges can therefore trigger false Fail2ban bans (see #514).

Pass whether credentials were supplied to auth_error(). Missing credentials are logged as Authentication required; supplied-but-rejected credentials retain the existing failure message. HTTP responses, denial accounting and credential validation are unchanged.

Extend the existing test client with a repeatable --header option and add regression checks to the existing test runner for proxy/statistics challenges, invalid credentials and valid credentials.

Validation:

  • 1.11.3 builds with the source change applied.
  • Extended make test: 0 errors.
  • Local HTTPS CONNECT tests: missing credentials still receive 407; wrong passwords still log failures; valid credentials succeed.
  • Eight .NET 6 HTTPS requests succeed with zero false failure entries, both with default settings and PreAuthenticate=true (eight false entries before the fix).
  • Perl/shell syntax checks and git diff --check pass.

The patch is prepared against master e8f2f99. Runtime validation used the 1.11.3 release build with the same source change and updated test scripts.

@rofl0r
rofl0r merged commit 330e6b4 into tinyproxy:master Nov 23, 2026
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.

BasicAuth challenges are logged as failed authentication attempts, causing false Fail2ban bans

2 participants