Repository navigation
Replace bcrypt challenge auth with direct password comparison - #9358
Conversation
95ade11 to
690c7c1
Compare
Frenzie
left a comment
There was a problem hiding this comment.
Fwiw I think the idea is that the bcrypt encryption protects against getting the password almost by accident (read: effortlessly, completely untargeted) in logs or some such, not that it's some kind of brilliant protection.
In any case, nothing jumps out at me in the PR.
|
#9362 needs to be merged before this PR |
|
I improved the tests a bit. |
|
Will also remove done |
But add `pattern` again for some nojs support
|
Let's go for it, but we need to warn a bit in advance. |
|
Is there anything I should change in the PR? |
|
I forgot about 50c36b8, is it still ok? |
| header('HTTP/1.1 500 Internal Server Error'); | ||
| Minz_Request::setBadNotification(_t('install.session.nok')); | ||
| Minz_Request::forward(['c' => 'auth', 'a' => 'login'], false); | ||
| Minz_Request::forward(['c' => 'auth', 'a' => 'login'], redirect: true); |
There was a problem hiding this comment.
This is still sending a proper HTTP 500, right?
There was a problem hiding this comment.
No, because redirects only work with 3xx status codes.
But at the same time a redirect is needed here currently, due to a Minz bug that is yet to be addressed: #8535 (we don't want to leak passwordPlain in GET params)
There was a problem hiding this comment.
I forgot about this though
| $challenge = Minz_Request::paramString('challenge'); | ||
| $newPasswordPlain = ''; | ||
| if ($challenge !== '') { | ||
| $passwordPlain = Minz_Request::paramString('passwordPlain', plaintext: true, trim: false); | ||
| $newPasswordPlain = Minz_Request::paramString('newPasswordPlain', plaintext: true, trim: false); | ||
| $confirmPasswordPlain = Minz_Request::paramString('confirmPasswordPlain', plaintext: true, trim: false); | ||
| if ($passwordPlain !== '') { | ||
| $username = Minz_User::name(); | ||
| $nonce = Minz_Session::paramString('nonce'); | ||
| Minz_Session::_param('nonce', false); // One-time: consume the challenge so it cannot be replayed. | ||
|
|
||
| $newPasswordPlain = Minz_Request::paramString('newPasswordPlain', plaintext: true); | ||
| $confirmPasswordPlain = Minz_Request::paramString('confirmPasswordPlain', plaintext: true); |
* Fix current password requirement during password changes Regression from #9358 (follow-up, PR not present in a stable/versioned release) Fix [GHSA-5vxm-62pg-frff](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-5vxm-62pg-frff) * Remove stale client side bcrypt comment from passwordUtil * docs: PHP 8.1 is no longer supported * Minor typographic preference --------- Co-authored-by: Alexandre Alapetite <[email protected]>
Regression from #9358 (PR not present in current release, stopped sending 403 on failed logins). This PR fixes the Minz bug mentioned in #9358 (comment) which occurred with `redirect: false` redirects. But it also takes a different approach for redirecting, by using HTML instead of the `Location` header (to address one additional issue with a resubmit prompt appearing when refreshing the login page after a failed login). 403 is now returned during failed reauthentication as well.
So if I understand this correctly this will make the password visible on any reverse proxy with ssl/tls termination, which is commonly hosted in a dmz (ie. low trust), which is a very common scenario? So effectively this simplification to the codebase made the product less secure? |
|
Yes, that means there's less passive observer protection, though whether it actually makes it less secure is debatable. Anything that terminates TLS like that could also simply replace the HTML with whatever it wants thus undoing the client-side bcrypt. |
Sure, but if the low trust dmz rp gets hacked (very likely in this day and age!) then plain text password sniffing is just easy peasy, I would prefer they just get hashes instead. You can learn a lot from a user's password imho... At least the password is not in a url query parameter but in POST request (I hope 😉 ?) I personally think this pull is a mistake. Following Nextcloud and using Argon2id with Argon2i & bcrypt fallbacks as authentication password hashing method would be my preference. |
|
The cleanup was mostly just removing it. I don't think adding it back would look substantially different. Either way I'm neutral on the matter. |
Instead of just adding it back it would probably make more sense to upgrade to a more modern approach, with some brute-force GPU hacking protection built in. Also Nextcloud uses it, so couldn't be all bad. Maybe this is of help (not mine, but gave me some insight): transitioning to argon2id from bcrypt: https://gyaando.com/php-password-hash-bcrypt-vs-argon2id/ |
|
Maybe, but that doesn't affect what I said. ;-) |
Ok so there probably wont be a feature request adding (more modern) password hashing support back in any time soon. More of a ‘spare time’ kind of thing, I guess. But can we just roll back this pull then? I don’t really understand what was ‘won’ by removing something that does work in obfuscating ‘real’ user passwords on low trust environments, so nothing is ‘won’ and “authentication uses no javascript anymore” is a very bad argument as everything after login DOES use javascript… so this is just weird and AM really passionate of retaining at least this feature. So everything short of ‘pretty please’, but PRETTY PLEASE 🙏 ✌️😉 |
|
Communication asking for comments: https://framapiaf.org/@freshrss/117509044759169110 |
Yeah well for me its just
I know its FOSS, sure, but the negatives just clearly outweigh the positives imho and removing a thing that does at least ‘something’ for security/privacy is just a weird action. In my opinion FOSS should be about always improving not removing; willy-nilly and “Always take your time, for any change is your baby” just my 2 cents, because I care. |
…735) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [freshrss/freshrss](https://freshrss.org/) ([source](https://github.com/FreshRSS/FreshRSS)) | minor | `1.30.4-alpine` → `1.31.0-alpine` | --- ### Release Notes <details> <summary>FreshRSS/FreshRSS (freshrss/freshrss)</summary> ### [`v1.31.0`](https://github.com/FreshRSS/FreshRSS/blob/HEAD/CHANGELOG.md#2026-11-23-FreshRSS-1310) [Compare Source](FreshRSS/FreshRSS@1.30.4...1.31.0) - Compatibility - 💥 Require PHP 8.2+ (drop PHP 8.1) [#​9470](FreshRSS/FreshRSS#9470), [GHSA-66ff-8p23-wx95](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-66ff-8p23-wx95) - And recommend PHP 8.4+ for native HTML5 parsing (compliance, security, performance) - Features - Use PHP 8.4+ `\Dom` classes and functions when available (polyfill for PHP < 8.4) [#​9567](FreshRSS/FreshRSS#9567) - Polyfill `GT\CssXPath`: Add support for case insensitivity [phpgt/CssXPath#256](phpgt/CssXPath#256) - Use native HTML5 `<img loading="lazy"` instead of custom JavaScript [#​5816](FreshRSS/FreshRSS#5816), [#​9601](FreshRSS/FreshRSS#9601), [GHSA-fc53-pf4q-9phm](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-fc53-pf4q-9phm) - User queries can define their own sorting criterion (field and direction) [#​8954](FreshRSS/FreshRSS#8954) - Better catch and log user regex errors [#​9559](FreshRSS/FreshRSS#9559) - Sharing by RSS emit `<enclosure>` for BitTorrent attachments [#​9553](FreshRSS/FreshRSS#9553) - Add filter preview button to label configuration [#​9538](FreshRSS/FreshRSS#9538) - Bug fixes - Fix HTTP Retry-After cache when proxy is used [#​9508](FreshRSS/FreshRSS#9508) - Fix 32-bit systems provide a string for SQL BIGINT [#​9486](FreshRSS/FreshRSS#9486) - Fix tests for 32-bit systems [#​9578](FreshRSS/FreshRSS#9578) - Fix API lookup of the localised default category [#​9543](FreshRSS/FreshRSS#9543) - Keep JSON feed attachments as enclosures [#​9510](FreshRSS/FreshRSS#9510) - Fix: do not double-encode titles and authors when importing JSON [#​9556](FreshRSS/FreshRSS#9556) - Fix OPML import of numeric-string category names [#​9552](FreshRSS/FreshRSS#9552) - Fix saved search references with overlapping IDs or names [#​9484](FreshRSS/FreshRSS#9484), [#​9524](FreshRSS/FreshRSS#9524) - Fix shared queries: keep user search in HTML pagination [#​9545](FreshRSS/FreshRSS#9545) - Fix non-ASCII characters in scripts of fetched HTML pages [#​9384](FreshRSS/FreshRSS#9384) - PostgreSQL: detect FreshRSS tables by visibility rather than owner [#​9535](FreshRSS/FreshRSS#9535) - Fix UI: Load theme icons in views rendered without layout [#​9564](FreshRSS/FreshRSS#9564) - GReader API: compare `Authorization:GoogleLogin` and other headers case insensitive [#​9534](FreshRSS/FreshRSS#9534) - Return false when the configuration file cannot be replaced [#​9580](FreshRSS/FreshRSS#9580) - Fix technical details in documentation system [#​9520](FreshRSS/FreshRSS#9520), [#​9521](FreshRSS/FreshRSS#9521) - Security - 💥 Replace bcrypt challenge auth with direct password comparison [#​9358](FreshRSS/FreshRSS#9358), [#​9550](FreshRSS/FreshRSS#9550), [#​9566](FreshRSS/FreshRSS#9566), [GHSA-8pvw-w7w8-vjj7](GHSA-8pvw-w7w8-vjj7), [GHSA-5vxm-62pg-frff](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-5vxm-62pg-frff) - Search: quote parentheses and `OR` when serialising terms [#​9541](FreshRSS/FreshRSS#9541) - Use HTTP header `Cross-Origin-Opener-Policy: same-origin` [#​9588](FreshRSS/FreshRSS#9588), [GHSA-75f7-8cvm-v87v](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-75f7-8cvm-v87v), [GHSA-gpvq-chwv-g674](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-gpvq-chwv-g674) - WebSub security: Implement support for `hub.secret` [#​9430](FreshRSS/FreshRSS#9430), [GHSA-498g-vgpq-mr66](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-498g-vgpq-mr66) - Reduce risk of data cache leak [#​9591](FreshRSS/FreshRSS#9591), [GHSA-4r8m-g5px-6pg7](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-4r8m-g5px-6pg7), [GHSA-fhcq-gjx8-fg9g](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-fhcq-gjx8-fg9g) - Fix leak of feed credentials to anonymous readers [#​9591](FreshRSS/FreshRSS#9591), [GHSA-fr4r-3w2g-rqf5](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-fr4r-3w2g-rqf5) - Sanitize Punycode [#​9591](FreshRSS/FreshRSS#9591), [GHSA-qv45-78vh-92w4](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-qv45-78vh-92w4) - Validate domain in SSRF check [#​9611](FreshRSS/FreshRSS#9611), [GHSA-3ch8-46c3-xr9h](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-3ch8-46c3-xr9h) - Fix search references [#​9591](FreshRSS/FreshRSS#9591), [GHSA-qwpx-vccf-m8xf](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-qwpx-vccf-m8xf) - Prevent use of irrelevant parameter in shared user queries [#​9589](FreshRSS/FreshRSS#9589), [GHSA-9v4j-jqr6-4cvv](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-9v4j-jqr6-4cvv) - Fix user enumeration by probing inconsistent error responses on failed logins [#​9568](FreshRSS/FreshRSS#9568) - Safer login [#​9592](FreshRSS/FreshRSS#9592), [#​9598](FreshRSS/FreshRSS#9598), [GHSA-rqqp-9h9w-h9m5](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-rqqp-9h9w-h9m5) - More secure remove access [#​9610](FreshRSS/FreshRSS#9610), [GHSA-r27w-hr3c-hjr3](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-r27w-hr3c-hjr3) - Better sanitize bookmark [#​9594](FreshRSS/FreshRSS#9594), [GHSA-jc2v-8853-5jqf](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-jc2v-8853-5jqf) - Fix escape labels during JSON import and render tag dropdown as text [#​9504](FreshRSS/FreshRSS#9504), [GHSA-4vcq-4q92-v45q](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-4vcq-4q92-v45q) - More security for extension files: `X-Content-Type-Options: nosniff` [#​9593](FreshRSS/FreshRSS#9593), [GHSA-w38f-92pp-95hg](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-w38f-92pp-95hg) - Fix HTML injection in view mode error notification [#​9605](FreshRSS/FreshRSS#9605), [GHSA-wpf6-5v7v-6cvj](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-wpf6-5v7v-6cvj) - Fix HTML injection in extension names [#​9608](FreshRSS/FreshRSS#9608), [GHSA-crc7-3qcq-m9h3](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-crc7-3qcq-m9h3) - Fix full-content logic [#​9602](FreshRSS/FreshRSS#9602), [GHSA-5hcv-wqwr-j8r8](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-5hcv-wqwr-j8r8) - Sanitize DB install params [#​9595](FreshRSS/FreshRSS#9595), [GHSA-xm97-f66c-q5fx](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-xm97-f66c-q5fx) - Document threat model for security scanners [#​9509](FreshRSS/FreshRSS#9509) - Enrolled in Anthropic OSS Scanner service that scans critical open-source repositories for security vulnerabilities [anthropics/oss-scanner#1434](anthropics/oss-scanner#1434) - Use a keyed hash for favicon cache keys [#​9518](FreshRSS/FreshRSS#9518), [GHSA-jqm2-jqjv-m87h](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-jqm2-jqjv-m87h) - Performance - SQL speed improvement for batch mark as read under SQLite and PostgreSQL [#​9575](FreshRSS/FreshRSS#9575) - SimplePie - Use PHP 8.4+ `\Dom` classes and functions when available (polyfill for PHP < 8.4) [FreshRSS/simplepie#98](FreshRSS/simplepie#98) - Upgrade to PHPStan 2 [FreshRSS/simplepie#97](FreshRSS/simplepie#97), [simplepie#939](simplepie/simplepie#939) - Add unit test for HTML5 sanitizing compliance [simplepie#1022](simplepie/simplepie#1022) - Remove obsolete `xml_is_sane` and `XMLReader` fallback [simplepie#1023](simplepie/simplepie#1023) - Bump [#​9562](FreshRSS/FreshRSS#9562), [FreshRSS/simplepie#96](FreshRSS/simplepie#96) - Remove support for local files - Ignore whitespace before the XML declaration - Treat https Atom 1.0 namespace as Atom - Deployment - Docker: dev image `freshrss/freshrss:oldest` updated to Alpine 3.18 with PHP 8.2.16 and Apache 2.4.62 [#​9470](FreshRSS/FreshRSS#9470) - Docker: dev image `freshrss/freshrss:newest` updated with PHP 8.6.0 and Apache 2.4.71 - Docker: dev image `freshrss/freshrss:newest` updated to use HTTPs for downloading packages [#​9584](FreshRSS/FreshRSS#9584) - UI - Add option to open articles on their original website by default [#​9554](FreshRSS/FreshRSS#9554) - <kbd>Esc</kbd> leaves the search box [#​9462](FreshRSS/FreshRSS#9462) - Extensions - Add `feeds_after_actualize` hook [#​9438](FreshRSS/FreshRSS#9438) - I18n - Add current English text to `DIRTY` translation comments [#​9525](FreshRSS/FreshRSS#9525) - Add Arabic [#​9502](FreshRSS/FreshRSS#9502) - Improve Portuguese [#​9573](FreshRSS/FreshRSS#9573), [#​9583](FreshRSS/FreshRSS#9583) - Improve traditional Chinese [#​9540](FreshRSS/FreshRSS#9540), [#​9590](FreshRSS/FreshRSS#9590) - CI/CD - Add a link checker workflow using lychee [#​9209](FreshRSS/FreshRSS#9209), [#​9495](FreshRSS/FreshRSS#9495), [#​9507](FreshRSS/FreshRSS#9507), [#​9511](FreshRSS/FreshRSS#9511), [#​9614](FreshRSS/FreshRSS#9614) - Update to PHPUnit 11.x (PHP 8.2+) [#​9470](FreshRSS/FreshRSS#9470) - Group auto dependency updates into one PR per ecosystem [#​9496](FreshRSS/FreshRSS#9496) - Misc. - New `make test-all-php-versions` to run tests with all supported PHP versions in Docker [#​9576](FreshRSS/FreshRSS#9576), [#​9606](FreshRSS/FreshRSS#9606) - Fix `make start` stopping on terminal resize [#​9603](FreshRSS/FreshRSS#9603) - Update dev dependencies [#​9494](FreshRSS/FreshRSS#9494), [#​9497](FreshRSS/FreshRSS#9497), [#​9498](FreshRSS/FreshRSS#9498), [#​9499](https://github.com/FreshRSS/FreshRSS/pull/9499),[#​9500](https://github.com/FreshRSS/FreshRSS/pull/9500),[#​9501](https://github.com/FreshRSS/FreshRSS/pull/9501), [#​9522](FreshRSS/FreshRSS#9522), [#​9523](FreshRSS/FreshRSS#9523), [#​9561](FreshRSS/FreshRSS#9561) </details> --- ### Configuration 📅 **Schedule**: (in timezone Europe/Rome) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yNTcuOSIsInVwZGF0ZWRJblZlciI6IjQ0LjI1Ny45IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL21pbm9yIl19--> Reviewed-on: https://git.aresu.eu/GiorgioAresu/home-ops/pulls/2735
Closes #2428
Highlights:
bcrypt.jsdependency, so authentication no longer depends on JavaScript.nonceendpoint from thejavascriptcontroller.<noscript>blocks that were only needed for the previous authentication flow.FreshRSS_FormAuth::checkCredentials()to accept the username, stored bcrypt hash, and plain-text password directly.FreshRSS_FormAuth::passwordRequirementsMet()to replaceFreshRSS_password_Util::check().TextEncoderanddata-max-bytes.FormAuthTestto cover:bcrypt.jsfrom the documented dependencies and updated the authentication documentation.This simplifies the authentication flow, removes the client-side bcrypt challenge, makes password validation consistent between the client and server, and adds more test coverage while keeping compatibility with existing bcrypt password hashes.
Because the password is now sent directly to the server instead of being processed by
bcrypt.js, deployments should use HTTPS. Documentation for HTTPS setup can be handled separately.Prerequisite: #9362 should be merged before this PR.