This is an automated email from the ASF dual-hosted git repository.

papegaaij pushed a commit to branch crypt-unification
in repository https://gitbox.apache.org/repos/asf/wicket.git

commit a1864aeaf6687eb1bcade8c8b08a588b9ecdb6ab
Author: Emond Papegaaij <[email protected]>
AuthorDate: Tue Aug 4 13:34:23 2026 +0200

    WICKET-7190 State the page store trust boundary on the crypt API
    
    The redesigned crypt classes document what they guarantee, but not the 
limits
    of that guarantee. Both points were made in the javadoc of the ICrypter
    implementations this branch removes, and until now survived only in
    StoreSettings#setEncrypted, the user guide and SECURITY.md - none of which a
    reader lands on when they open CryptingPageStore or implement ICryptScheme.
    
    Record on CryptingPageStore that the session-held key protects the stored
    pages against a party who can read or write the underlying store, but not
    against one who already controls the session, so the store is still trusted
    storage. Note on ICryptScheme that a custom scheme returning unverified
    plaintext instead of null removes the tamper detection callers rely on, and
    point both at SECURITY.md.
    
    Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
---
 .../main/java/org/apache/wicket/core/util/crypt/ICryptScheme.java   | 5 +++++
 .../main/java/org/apache/wicket/pageStore/CryptingPageStore.java    | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git 
a/wicket-core/src/main/java/org/apache/wicket/core/util/crypt/ICryptScheme.java 
b/wicket-core/src/main/java/org/apache/wicket/core/util/crypt/ICryptScheme.java
index ac8a124cdb..175c7be3e1 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/core/util/crypt/ICryptScheme.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/core/util/crypt/ICryptScheme.java
@@ -38,6 +38,11 @@ import javax.crypto.SecretKey;
  * <p>
  * Implementations must be thread-safe and pick a unique, stable {@link 
#id()}. Wicket reserves
  * ids {@code 1..31}; custom schemes should use ids {@code >= 32}.
+ * <p>
+ * A custom scheme that does not honour the AEAD contract - returning 
unverified plaintext instead
+ * of {@code null} on authentication failure - silently removes the tamper 
detection that callers
+ * rely on. See {@code SECURITY.md} for the trust assumptions Wicket makes 
about encrypted data,
+ * and {@link org.apache.wicket.pageStore.CryptingPageStore} for the 
page-store use of a scheme.
  */
 public interface ICryptScheme
 {
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/pageStore/CryptingPageStore.java 
b/wicket-core/src/main/java/org/apache/wicket/pageStore/CryptingPageStore.java
index 0a0abe9a25..44235c5b77 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/pageStore/CryptingPageStore.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/pageStore/CryptingPageStore.java
@@ -43,6 +43,12 @@ import org.apache.wicket.util.lang.Args;
  * Each session gets its own random 256-bit AES key. Encryption uses the 
application's configured
  * {@link SecuritySettings#getCryptScheme() crypt scheme}; a page that can no 
longer be decrypted
  * (e.g. because the session key is gone or the data was tampered with) is 
treated as a cache miss.
+ * <p>
+ * Because the key lives in the session, the encryption protects the stored 
pages against a party
+ * who can read or write the underlying store - not against one who already 
controls the session.
+ * The store should therefore still be treated as trusted, private storage: 
Wicket deserializes
+ * whatever it reads back from it. See {@code SECURITY.md} for the trust 
assumptions Wicket makes
+ * about the page store.
  */
 public class CryptingPageStore extends DelegatingPageStore
 {

Reply via email to