Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #417 +/- ##
============================================
- Coverage 82.42% 81.68% -0.74%
- Complexity 3265 3279 +14
============================================
Files 106 106
Lines 9654 9685 +31
============================================
- Hits 7957 7911 -46
- Misses 1697 1774 +77
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
usernane
force-pushed
the
dev
branch
2 times, most recently
from
September 21, 2026 22:33
ee6f3df to
b4da787
Compare
…orage layer The new per-key session system stored values as plaintext JSON, dropping the SESSION_KEY encryption-at-rest that the old blob system provided. Fix: Session::encryptValue() / Session::decryptValue() — encryption belongs in Session, not in a storage wrapper. Session owns its ID (used as a salt in key derivation), knows SESSION_KEY, and is the correct owner of what enters and leaves storage. Storage backends stay storage-only. - Session::set() encrypts before storage->write() - Session::get() decrypts after storage->read() - Session::getVars(), refresh(), start() snapshot population all decrypt - Session::writeWithRetry() callback receives decrypted value - Key: SHA-256(SESSION_KEY + sessionId), matching old whole-blob scheme - Graceful fallback: no SESSION_KEY = no-op; non-ENC: values pass through - 5 new tests in SessionEncryptionTest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a security regression in the v3.1.0 per-key session system where
SESSION_KEYencryption was silently dropped.Problem
The old whole-blob session serialization encrypted the entire session with AES-256-GCM when
SESSION_KEYwas set. The new per-key storage system wrote values as plain JSON, ignoringSESSION_KEYentirely.Fix
Encryption belongs in
Session, not in a storage wrapper.Sessionowns its ID (used as a salt in key derivation), knowsSESSION_KEY, and is the correct owner of what enters and leaves storage. Storage backends stay storage-only.Session::encryptValue()— AES-256-GCM encrypt beforestorage->write()Session::decryptValue()— decrypt afterstorage->read()set(),get(),getVars(),refresh(),start()snapshot,writeWithRetry()SHA-256(SESSION_KEY + sessionId), matching old whole-blob schemeSESSION_KEY= no-op; non-ENC:values pass throughTests
5 new tests in
SessionEncryptionTest: encrypted at rest, transparent get, round-trip across instances, getVars, remove.Checklist
EncryptedSessionStorageclass — correct layering, storage stays storage-only