Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Make compromised-password validation opt-in - #8767

Open
yguedidi wants to merge 3 commits into
masterfrom
feat/hibp-password-validation
Open

Make compromised-password validation opt-in#8767
yguedidi wants to merge 3 commits into
masterfrom
feat/hibp-password-validation

Conversation

@yguedidi

@yguedidi yguedidi commented Mar 26, 2026

Copy link
Copy Markdown
Contributor
Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Documentation yes
Translation no
CHANGELOG.md no
License MIT

This PR makes wallabag's compromised-password validation opt-in. Admins can enable the HIBP-backed check with WALLABAG_NO_COMPROMISED_PASSWORDS=1; when the variable is absent, wallabag skips the extra network call and leaves password validation unchanged.

The same opt-in flag now controls NewUserType, ChangePasswordType, and the production installer. The committed development .env enables the check for contributors, and the admin parameters documentation explains how to enable it in real deployments.

When the check is enabled, wallabag still uses Symfony's NotCompromisedPassword constraint with skipOnError: true, so temporary HIBP failures do not block offline or CI workflows.

@netlify

netlify Bot commented Mar 26, 2026

Copy link
Copy Markdown

Deploy Preview for wallabag-doc ready!

Name Link
🔨 Latest commit 8c49479
🔍 Latest deploy log https://app.netlify.com/projects/wallabag-doc/deploys/69d4ceec917a6f000897e347
😎 Deploy Preview https://deploy-preview-8767--wallabag-doc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@yguedidi yguedidi added this to the 2.7.0 milestone Mar 26, 2026
@codecov

codecov Bot commented Mar 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.28571% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.39%. Comparing base (cf519d1) to head (8c49479).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/Command/InstallCommand.php 25.00% 15 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #8767      +/-   ##
============================================
- Coverage     91.59%   91.39%   -0.20%     
- Complexity     1989     1996       +7     
============================================
  Files           175      175              
  Lines          7007     7031      +24     
============================================
+ Hits           6418     6426       +8     
- Misses          589      605      +16     
Flag Coverage Δ
functional 76.15% <52.38%> (-0.24%) ⬇️
integration 21.28% <11.90%> (-0.06%) ⬇️
unit 24.88% <0.00%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/Form/Type/ChangePasswordType.php 100.00% <100.00%> (ø)
src/Form/Type/NewUserType.php 100.00% <100.00%> (ø)
src/Command/InstallCommand.php 80.40% <25.00%> (-5.19%) ⬇️

... and 1 file with indirect coverage changes

@yguedidi
yguedidi force-pushed the feat/hibp-password-validation branch 2 times, most recently from 60fc027 to cd170df Compare March 26, 2026 12:18
@yguedidi
yguedidi marked this pull request as ready for review March 26, 2026 12:23
@yguedidi
yguedidi marked this pull request as draft March 26, 2026 12:24
@yguedidi
yguedidi marked this pull request as ready for review March 26, 2026 12:24
@yguedidi
yguedidi requested review from Kdecherf, j0k3r and nicosomb March 26, 2026 12:24

@Kdecherf Kdecherf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM on the implementation side

However two mandatory changes:

  • we need to add a note in the doc about this new security feature and how admin can configure it
  • we need to keep it configurable for admin who would like to avoid additional network calls for this kind of feature, I would see this feature as disabled by default

@yguedidi

Copy link
Copy Markdown
Contributor Author

we need to add a note in the doc about this new security feature and how admin can configure it

seems not possible in the end, for now, to not deploy the change..

we need to keep it configurable for admin who would like to avoid additional network calls for this kind of feature, I would see this feature as disabled by default

@nicosomb @j0k3r any opinion here? to me as it's security related I'd tend to prefer having it enabled by default but allow admins to disable it if they really really want

@yguedidi
yguedidi marked this pull request as draft March 31, 2026 23:22
@yguedidi

yguedidi commented Apr 6, 2026

Copy link
Copy Markdown
Contributor Author

we need to keep it configurable for admin who would like to avoid additional network calls for this kind of feature

@Kdecherf FYI I'll wait for #8776 to be merge to introduce the new setting 🙁

@yguedidi
yguedidi force-pushed the feat/hibp-password-validation branch from cd170df to f18dc55 Compare April 7, 2026 08:59
yguedidi added 3 commits April 7, 2026 11:14
Add WALLABAG_NO_COMPROMISED_PASSWORDS with a default-off container fallback, wire it into the password form types, enable it in the development .env, and document the setting in the admin parameter reference.

The configuration surface and the form-level enforcement are one reviewer question: how the compromised-password feature is activated for normal user flows. Keeping the docs here makes the public opt-in contract visible at the same boundary.

The installer path is intentionally deferred to the next commit so production setup behavior can be reviewed separately from the form wiring.
Make InstallCommand honor WALLABAG_NO_COMPROMISED_PASSWORDS before adding the NotCompromisedPassword constraint to the production admin-password prompt.

The installer is a distinct review boundary because it extends the opt-in contract to setup-time behavior without touching the already-wired user-facing forms.

The test-only password randomization remains in the following commit so the validation-specific fixture cleanup stays isolated.
…dation

Update the functional tests to generate random passwords instead of using hardcoded common passwords that the compromised-password check can legitimately reject.

Keeping this test-only cleanup separate preserves the story of the feature work and makes it obvious that no runtime behavior changes happen in this commit.
@yguedidi
yguedidi force-pushed the feat/hibp-password-validation branch from f18dc55 to 8c49479 Compare April 7, 2026 09:31
@yguedidi yguedidi changed the title Add HIBP password validation to user creation, password change, and install Make compromised-password validation opt-in Apr 7, 2026
@yguedidi
yguedidi requested a review from Kdecherf April 7, 2026 09:33
@yguedidi

yguedidi commented Apr 7, 2026

Copy link
Copy Markdown
Contributor Author

@Kdecherf PR updated! you can check this force-push diff to see all changes since last time you reviewed, or do a full review as it's small enough :)

@yguedidi
yguedidi marked this pull request as ready for review April 7, 2026 09:34
@nicosomb

nicosomb commented Apr 8, 2026

Copy link
Copy Markdown
Member

I love this feature. Well done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants