Find insecure cipher modes and padding schemes

Proprietary

Finds uses of Cipher.getInstance(...) whose transformation string selects an insecure mode or padding. Flags two patterns: ECB mode for any non-RSA algorithm (repeated plaintext blocks produce identical ciphertext blocks), and CBC mode with a padding scheme other than NoPadding (vulnerable to padding oracle attacks). For AES, prefer an authenticated mode such as GCM; for RSA, see FindRsaWithoutOaep.

org.openrewrite.java.security.search.FindInsecureCipherMode
mod run . --recipe=org.openrewrite.java.security.search.FindInsecureCipherMode

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.