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

Security Enhancement Proposal #668

Open
sy2339226 opened this issue Jun 14, 2024 · 0 comments
Open

Security Enhancement Proposal #668

sy2339226 opened this issue Jun 14, 2024 · 0 comments

Comments

@sy2339226
Copy link

Overview

I've identified several critical security concerns in the Duplicacy project that compromise the integrity and confidentiality of data. The issues pertain to the usage of deprecated cryptographic algorithms and insecure configurations. Below, I detail the problems and propose solutions to enhance the software's security posture.

Issue 1: Static Salt in Master Key Generation

In the file duplicacy/src/duplicacy_config.go, the master key generation uses a static salt, which is a significant security flaw. Static salts reduce the effectiveness of password hashing, making it easier for attackers to guess or crack passwords through dictionary or rainbow table attacks.

Recommendation

Transition to using dynamic, per-password salts for generating master keys. This ensures that even identical passwords will produce different hashes, enhancing resistance against attacks.

Issue 2: SHA1 for File Integrity Verification

Within duplicacy/src/duplicacy_b2client.go, SHA1 is employed as the hashing algorithm for file integrity checks. SHA1 is outdated and susceptible to collision attacks, meaning two different files could have the same hash value, undermining the trustworthiness of file verification processes.

Recommendation

Upgrade to SHA256 or a stronger hash function for file integrity checks. This change is crucial for maintaining data integrity against active adversaries.

Issue 3: Insecure SSH Cipher Suites and Algorithms

The file duplicacy/src/duplicacy_sftpstorage.go contains configurations that permit the use of weak and outdated cipher suites and algorithms, such as RC4, AES-CBC, and SHA1. These algorithms have known vulnerabilities that can be exploited by attackers:

  • RC4: This stream cipher has been shown to have biases in the initial bytes of the keystream, enabling attacks that recover plaintext from ciphertext. It is also vulnerable to related-key attacks.
  • AES-CBC: While CBC mode is not inherently flawed, its usage often lacks proper precautions against padding oracle attacks. Moreover, CBC is less efficient than newer modes like GCM.
  • SHA1: This hash function is no longer considered secure due to successful collision attacks, which can be used to forge digital signatures or manipulate data integrity checks.

Recommendation

Discontinue support for RC4, AES-CBC, and SHA1. Opt for modern, secure alternatives such as AES-GCM for symmetric encryption and SHA256 for hash functions. Ensure that key exchange mechanisms prioritize elliptic curve cryptography (ECC) for enhanced security.


Action Items

To address these vulnerabilities effectively, I propose the following steps:

  1. Update Master Key Generation: Implement a mechanism to generate dynamic salts for each password, improving the robustness of the hashing process.
  2. Hash Function Upgrade: Replace SHA1 with SHA256 for all file integrity checks, ensuring that data is protected against collision attacks.
  3. SSH Cipher Suite Revision: Modify the SSH client configuration to exclude RC4, AES-CBC, and SHA1, and promote the use of more secure ciphers and hash functions.

I am committed to contributing to the resolution of these issues and am available to collaborate with the Duplicacy team in implementing these changes. Let's work together to strengthen Duplicacy's security and protect our users' data.


Important Note

Before proceeding with these changes, it is imperative to conduct thorough testing and possibly consult with security experts to ensure that the updates do not inadvertently introduce new vulnerabilities or negatively impact system performance. A security audit may be beneficial to validate the effectiveness of the proposed enhancements.

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