Unicorn with delicious cookie
Nous utilisons des cookies pour améliorer votre expérience de navigation. En savoir plus
Accepter
to the top
>
>
>
V5313. OWASP. Do not use old versions o…
menu mobile close menu
Analyzer diagnostics
General Analysis (C++)
General Analysis (C#)
General Analysis (Java)
Micro-Optimizations (C++)
Diagnosis of 64-bit errors (Viva64, C++)
Customer specific requests (C++)
MISRA errors
AUTOSAR errors
OWASP errors (C++)
OWASP errors (C#)
OWASP errors (Java)
Problems related to code analyzer
Additional information
toggle menu Contents

V5313. OWASP. Do not use old versions of SSL/TLS protocols as it may cause security issues.

04 Fév 2025

The analyzer has detected that the application uses legacy versions of the SSL/TLS protocol. This can expose the application to attacks such as man-in-the-middle, BEAST, etc.

Issues related to the use of outdated protocols can fall into two OWASP Top 10 2021 categories:

Look at the following example:

private void createSocket() {
    SSLContext sslContext;
    try {
        sslContext = SSLContext.getInstance("TLSv1");    // <=
    } catch (NoSuchAlgorithmException e) {
        throw new RuntimeException(e);
    }

    try {
        sslContext.init(null, null, new SecureRandom());
        var socketFactory = sslContext.getSocketFactory();
        var socket = (SSLSocket) socketFactory.createSocket();

        // ....

        socket.close();
    } catch (KeyManagementException | IOException e) {
        throw new RuntimeException(e);
    }
}

The code above contains the TLSv1 value that represents the 1.0 version of the TLS protocol. This version is outdated and not recommended because TLS 1.0 is vulnerable to a number of attacks, including the aforementioned BEAST.

Experts recommend using newer protocol versions, such as TLS 1.2:

private void createSocket() {
    SSLContext sslContext;
    try {
        sslContext = SSLContext.getInstance("TLSv1.2");
    } catch (NoSuchAlgorithmException e) {
        throw new RuntimeException(e);
    }

    try {
        sslContext.init(null, null, new SecureRandom());
        var socketFactory = sslContext.getSocketFactory();
        var socket = (SSLSocket) socketFactory.createSocket();

        // ....

        socket.close();
    } catch (KeyManagementException | IOException e) {
        throw new RuntimeException(e);
    }
}

Protocol versions below TLS 1.2 are not recommended as they may cause security issues. These protocols include SSL 2.0 and 3.0, as well as TLS 1.0 and 1.1.

Usually, TLS is the most appropriate value, which allows the platform to choose the data transfer protocol. If for some reason the value does not fit, set the latest version available.

Additional links:

This diagnostic is classified as:

close form

Remplissez le formulaire ci‑dessous en 2 étapes simples :

Vos coordonnées :

Étape 1
Félicitations ! Voici votre code promo !

Type de licence souhaité :

Étape 2
Team license
Enterprise licence
** En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité
close form
Demandez des tarifs
Nouvelle licence
Renouvellement de licence
--Sélectionnez la devise--
USD
EUR
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
La licence PVS‑Studio gratuit pour les spécialistes Microsoft MVP
close form
Pour obtenir la licence de votre projet open source, s’il vous plait rempliez ce formulaire
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
I want to join the test
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
check circle
Votre message a été envoyé.

Nous vous répondrons à


Si l'e-mail n'apparaît pas dans votre boîte de réception, recherchez-le dans l'un des dossiers suivants:

  • Promotion
  • Notifications
  • Spam