Skip to content

fix: PwnedValidator cannot reach the HIBP API - #1372

Merged
michalsn merged 3 commits into
codeigniter4:developfrom
michalsn:fix/pwned-validator-base-uri
Aug 18, 2026
Merged

fix: PwnedValidator cannot reach the HIBP API#1372
michalsn merged 3 commits into
codeigniter4:developfrom
michalsn:fix/pwned-validator-base-uri

Conversation

@michalsn

Copy link
Copy Markdown
Member

Description
This PR fixes PwnedValidator, which cannot reach the HaveIBeenPwned API on CodeIgniter v4.5.6+. Every password check fails with cURL error 6: Could not resolve host: range.

The validator passed the Guzzle-style base_uri option, while CURLRequest reads baseURI. This worked until v4.5.6, where Services::curlrequest() stopped reading base_uri (codeigniter4/CodeIgniter4#9296). Since then, the base URI is never applied, and the relative path range/<prefix> is treated as a hostname.

Instead of renaming the option key, the request now uses the absolute API URL. This works on every supported framework version, does not depend on the state of the shared curlrequest service, and is verifiable in tests - the existing tests now assert the exact URL sent, so a regression would fail immediately.

Fixes #1371

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@michalsn michalsn added the bug Something isn't working label Aug 17, 2026

@datamweb datamweb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM! Thanks.

@michalsn
michalsn merged commit b083f2c into codeigniter4:develop Aug 18, 2026
37 of 39 checks passed
@michalsn

Copy link
Copy Markdown
Member Author

Thanks for the reviews, guys! I will be releasing 1.4.1 today.

@michalsn
michalsn deleted the fix/pwned-validator-base-uri branch August 18, 2026 11:39
@michalsn michalsn mentioned this pull request Aug 18, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: PwnedValidator is broken: base_uri option is never read by CodeIgniter's CURLRequest

3 participants