
rrg (Community Member) asked a question.
CWE-757: Selection of Less-Secure Algorithm During Negotiation ('Algorithm Downgrade') is a new flaw that is now showing up for our Android Codebase. The first line below is what the scan points to:
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
sc = SSLContext.getInstance("TLS");
Looking at the Android documentation, it does not look like we are doing anything incorrect here? Not sure what the fix should be so any help is appreciated!
.png)
Hi @rrg (Community Member) ,
Great question! Veracode Static Analysis reports CWE 757 when it detects that you are allowing cipher suites that aren't the most secure ones available. In your particular case, you seem to be allowing all TLS versions, including v1.0 and v1.1 which aren't considered best practices anymore. We recommend that you either change the instance explicitly to TLSv1.2 or, if your library allows it, keep the general TLS but explicitly disallow versions v1.0 and v1.1.
Thank you,
Florian Walter