mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-08-19 01:15:04 -05:00
Default SESSION_DIGEST_METHOD from hashlib.sha1 to hashlib.sha256. HMAC-SHA1 is still cryptographically acceptable for the cookie's (sid, randval) signature, but SHA-256 is the modern default and aligns with the file-HMAC header introduced earlier in this branch. The session file format already invalidates all existing sessions on upgrade (the new HMAC header is required), so flipping this default at the same time is a free hardening rather than an additional break. Test polish from the post-merge hostile review: * Tighten the "no unsafe deserializer imported" assertion in the four cloud-module test files (RDS, Google, BigAnimal, Azure) to a regex anchored at line start with a word boundary, so it catches `from pickle import dumps, loads`, `import pickle as p`, and indented imports — not just bare `import pickle`. * test_login.py: drop a sid-rotation assertion that would have given false confidence. Flask-Paranoid does NOT rotate the session id on login (it binds a `_paranoid_token` to UA+IP and validates per request), so an `assertNotEqual(pre_sid, post_sid)` would always fail for the wrong reason. Comment the limitation in the test for the next reviewer; stronger fixation testing is owed as a follow-up. * docs/proposals: spec line numbers in §4.2 had drifted ~10 lines from the implemented branch (helper extraction, etc.); refresh them and the audit-summary table to point at HEAD-of-branch lines. Append a §1.6 entry enumerating the residual `pickle.loads` callsites in sqleditor / schema_diff / bgprocess that PR 7 / Phase 2 will close, so future reviewers see the surface.