Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage of weak crypto algorithms like SHA-1 in Stetho #708

Open
nidhi88 opened this issue Jan 18, 2022 · 1 comment
Open

Usage of weak crypto algorithms like SHA-1 in Stetho #708

nidhi88 opened this issue Jan 18, 2022 · 1 comment

Comments

@nidhi88
Copy link

nidhi88 commented Jan 18, 2022

Summary

Our Penetration testing team has identified usage of weak crypto algorithms like SHA-1 in Stetho and logged security vulnerability. What are the plans to migrate to the latest crypto algorithms? Can you please migrate to the latest crypto algorithms to mitigate this?

Recommendation:
Utilize cryptographic hashing algorithms that are considered secure and advocated for in best practice recommendations. Guidance can be found for Android For more guidance on best practices in picking strong cryptography, please see OWASP's Cryptographic Storage Cheat Sheet.

Motivations

Security Vulnerability.

@nidhi88
Copy link
Author

nidhi88 commented Oct 31, 2022

Hi @jasta

Can you please help check this??

below function from WebSocketHandler in package com.facebook.stetho.websocket uses SHA1 which is considered a weak crypto algorigthm.

private static String generateServerKey(String clientKey) {
    try {
      String serverKey = clientKey + SERVER_KEY_GUID;
      MessageDigest sha1 = MessageDigest.getInstance("SHA-1");
      sha1.update(Utf8Charset.encodeUTF8(serverKey));
      return Base64.encodeToString(sha1.digest(), Base64.NO_WRAP);
    } catch (NoSuchAlgorithmException e) {
      throw new RuntimeException(e);
    }
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant