[ 
https://issues.apache.org/jira/browse/WICKET-7190?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18105621#comment-18105621
 ] 

ASF subversion and git services commented on WICKET-7190:
---------------------------------------------------------

Commit 09e05c3d989cbb0642224ddc7a38abe940ef0f6d in wicket's branch 
refs/heads/master from Emond Papegaaij
[ https://gitbox.apache.org/repos/asf?p=wicket.git;h=09e05c3d98 ]

WICKET-7190 Unify and harden the cryptography subsystem (Wicket 11)

Replace the two disconnected crypt stacks (util.crypt.ICrypt and
pageStore.crypt.ICrypter) with a single authenticated, self-describing crypto
system in org.apache.wicket.core.util.crypt:

- ICryptScheme with AesGcmCryptScheme (JDK-native AES-256-GCM, the default) and
  AesGcmSivCryptScheme (AES-256-GCM-SIV, Bouncy Castle, optional). Ciphertext is
  prefixed with a one-byte scheme marker that is bound as AEAD associated data.
- SchemeCrypt selects the scheme by its marker against a configurable whitelist
  (downgrade protection), always encrypts with the strongest configured scheme,
  and returns null on any decryption failure.
- Key-source factories: KeyInSessionCryptFactory (per-session key, the default)
  and ApplicationKeyCryptFactory (application-wide key, used by remember-me).
- SecuritySettings owns the crypto policy (crypt scheme + whitelist); the page
  store, CryptoMapper and the remember-me cookie all use it.

This fixes the reported page-store weakness (unauthenticated AES-CBC, malleable
via CBC bit-flipping and vulnerable to a padding oracle) by making all
encryption authenticated, and removes the weak PBEWithMD5AndDES default that was
used for URLs and the authentication cookie.

Authenticated encryption uses a random nonce and is therefore non-deterministic.
CryptoMapper reuses, within a request, the ciphertext it decrypted so that a
regenerated URL matches the requested one; this avoids Wicket's 
URL-normalisation
infinite redirect while keeping random nonces (a nonce is only ever reused for
the identical plaintext).

Removes the obsolete implementations (SunJceCrypt, AbstractCrypt, TrivialCrypt,
CryptFactoryCachingDecorator, AESCrypt, AbstractJceCrypt,
KeyInSessionSunJceCryptFactory, AbstractKeyInSessionCryptFactory, 
DefaultCrypter,
GCMSIVCrypter, ICrypter) and adds a MigrateToWicket11 OpenRewrite recipe. Data
encrypted by Wicket 10 cannot be decrypted by Wicket 11 (clean break); the
marker/whitelist mechanism enables future migrations.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>


> Unified cryptography API
> ------------------------
>
>                 Key: WICKET-7190
>                 URL: https://issues.apache.org/jira/browse/WICKET-7190
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket-core
>            Reporter: Emond Papegaaij
>            Assignee: Emond Papegaaij
>            Priority: Major
>             Fix For: 11.0.0
>
>
> The current cryptography API in Wicket is split over {{ICrypt}} and 
> {{ICrypter}}. Both APIs serve a similar purpose but for different subsystems. 
> The goal is to unify these APIs and to allow the implementation of more 
> modern ciphers, with AEAD support. Also, the documentation on this API and 
> its implementations must be improved, clearly stating what it does and what 
> it does not deliver.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to