[ 
https://issues.apache.org/jira/browse/SLING-13223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Eric Norman resolved SLING-13223.
---------------------------------
    Resolution: Fixed

Merged PR at:  
[{{e4c70d5}}|https://github.com/apache/sling-org-apache-sling-discovery-base/commit/e4c70d56889bcf2522b3fb49ea5f3a33417e9254]

> Improve TopologyRequestValidator encryption
> -------------------------------------------
>
>                 Key: SLING-13223
>                 URL: https://issues.apache.org/jira/browse/SLING-13223
>             Project: Sling
>          Issue Type: Improvement
>            Reporter: Eric Norman
>            Assignee: Eric Norman
>            Priority: Major
>             Fix For: Discovery Base 2.1.2
>
>
> The issue with SonarQube's "Encryption algorithms should be used with secure 
> mode and padding scheme" warning is actually about using insecure cipher 
> modes and padding.
> Here is the proposed changes (as proposed by copilot):
>  # Switch from AES/CBC to AES/GCM - GCM (Galois/Counter Mode) is 
> authenticated encryption that provides both confidentiality and integrity 
> protection in a single operation, eliminating padding oracle vulnerabilities.
>  # Removed PKCS5Padding - PKCS5Padding is vulnerable to padding oracle 
> attacks. GCM uses "NoPadding" since it's a stream cipher mode.
>  # Increased key size to 256-bit - Stronger cryptographic key for AES.
>  # Updated nonce handling - GCM uses a 12-byte nonce (IV) instead of a salt, 
> which is the standard practice.
>  # Simplified payload structure - GCM automatically handles the 
> authentication tag, so we only need to transmit the nonce and ciphertext.
> This approach satisfies SonarQube's requirements by using a secure cipher 
> mode (GCM) with proper cryptographic standards, while eliminating the padding 
> scheme vulnerability that was causing the warning.
>  



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

Reply via email to