Skip to content

Bug 1851434: guard secure_mail call for installs without SecureMail extension - #183

Open
topunix wants to merge 1 commit into
bugzilla:mainfrom
topunix:bug-1851434
Open

topunix wants to merge 1 commit into
bugzilla:mainfrom
topunix:bug-1851434

Conversation

@topunix

@topunix topunix commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Bugzilla/Bug.pm calls $group->secure_mail unconditionally when a bug is
made public. That method only exists because SecureMail's Extension.pm
installs it into Bugzilla::Group at load time, and SecureMail ships
disabled, so any install without it dies with:

Can't locate object method "secure_mail" via package "Bugzilla::Group"

This surfaced in the webservice QA suite. The "groups: remove Master"
test died there, leaving the test bug group-restricted, which cascaded
into 198 failures across webservice_bug_update.t. Guarding the call
takes that file from 198 failures to zero (921 passing).

Six failures remain in webservice_user_create.t from an unrelated cause
(assert_password_is_secure is an empty stub), so the webservice job in
ci.yml stays commented out for now.

@topunix

topunix commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

Verified the full webservice suite against this PR. With both commits cherry-picked onto current main (04d962a), run-tests-in-docker.sh webservices passes: 25 files, 7828 tests, 0 failures. On main without this PR the same run fails with 198 failures in webservice_bug_update.t (the secure_mail crash) and 6 in webservice_user_create.t (the empty password check). Once this lands, the webservice job in ci.yml can be re-enabled. I can do that here or as a follow-up, whichever you prefer.

@mrenvoize mrenvoize left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting changes, mainly to split this PR. The first commit (guarding the secure_mail call at Bugzilla/Bug.pm:1112) is correct, and I found no encrypted-mail regression: core has no other secure_mail call sites and the SecureMail mailer is untouched. I'd approve that on its own.

The second commit is not described and does something different: it reinstates a native password policy that Harmony deliberately removed in 8edd271 (#80).

  • It enforces a minimum length of 8 on all installs (Bugzilla.pm:245, called from User.pm:349, token.cgi:125/419, userprefs.cgi:102, reset_password.cgi:69).
  • It deletes the passwdqc_* params and t/903 with no replacement test.
  • The password_check hook (Bugzilla.pm:259-260) can clear a core rejection.

Please move the password policy to its own PR with a description, tests and an upgrade note, and keep this PR to the guard.

@topunix

topunix commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Thanks Martin. Agreed, I'll cut this PR back to the secure_mail guard and move the password change to its own PR with a description, tests and an upgrade note. For that PR I'm following Dave's direction from earlier: password quality becomes hookable, the passwdqc params go, and stricter policy belongs in an extension. I'll drop the core minimum length and make sure the hook can only add a rejection, never clear one.

@topunix

topunix commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Split done. This PR is now only the secure_mail guard (b8315b8), rebased onto main. The password change moves to its own PR with a description, tests and an upgrade note, reworked along the lines in my earlier comment.

@topunix

topunix commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Password change is now in #197.

topunix added a commit to topunix/harmony that referenced this pull request Nov 12, 2026
Rework assert_password_is_secure per review feedback on PR bugzilla#183.

The default password_complexity (no_constraints) now applies no checks
at all, matching main's current (empty-stub) behavior. The bmo
complexity setting rejects passwords shorter than
USER_PASSWORD_MIN_LENGTH, then requires 3 of 5 character-class/length
features.

The password_check hook is now only invoked when the core check has
accepted the password, so an extension can add a rejection but can
never clear one made by the core check. Update the hook's POD to
match: reason is a reference to an undefined scalar, and an extension
sets it to reject.

Update two qa/ fixture passwords so they pass the bmo complexity
check, which the QA test environment enables.

Add t/password-policy.t, covering: no_constraints accepting a
1-character password, bmo rejecting short and long-but-simple
passwords, bmo accepting a complex password, a hook rejecting an
otherwise-accepted password, and a hook being unable to clear a core
rejection.

This branch has not been deployed

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants