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

fix(test-tooling): use of hardcoded password #2766

Open
jagpreetsinghsasan opened this issue Oct 11, 2023 · 4 comments · May be fixed by #3428
Open

fix(test-tooling): use of hardcoded password #2766

jagpreetsinghsasan opened this issue Oct 11, 2023 · 4 comments · May be fixed by #3428
Assignees
Labels
good-first-issue Good for newcomers good-first-issue-100-introductory Hacktoberfest Hacktoberfest participants are welcome to take a stab at issues marked with this label. P4 Priority 4: Low Security Related to existing or potential security vulnerabilities Tests Anything related to tests be that automatic or manual, integration or unit, etc.

Comments

@jagpreetsinghsasan
Copy link
Contributor

Description

Static source code assessment has picked up a potential vulnerability regarding use of hardcoded password.

The report from which the above information was summarized

Risk Rating: Low
Category: Sensitive data exposure

Description

The application codebase has string literal passwords embedded in the source code. This hardcoded value is used either to compare to user-provided credentials, or to authenticate downstream to a remote system (such as a database or a remote web service).  

Impact

Hardcoded passwords expose the application to password leakage. If an attacker gains access to the source code, she will be able to steal the embedded passwords, and use them to impersonate a valid user. This could include impersonating end users to the application, or impersonating the application to a remote system, such as a database or a remote web service. Once the attacker succeeds in impersonating the user or application, she will have full access to the system, and be able to do anything the impersonated identity could do.

Remediation Recommendation

Do not hardcode any secret data in source code, especially not passwords. In particular, user passwords should be stored in a database or directory service, and protected with a strong password hash (e.g. bcrypt, scrypt, PBKDF2, or Argon2). Do not compare user passwords with a hardcoded value. 
System passwords should be stored in a configuration file or the database, and protected with strong encryption (e.g. AES-256). Encryption keys should be securely managed, and not hardcoded.

Affected files (path - line number)

packages/cactus-test-tooling/src/main/typescript/openethereum/openethereum-test-ledger.ts - 236

Snapshot of the sourcecode at the time of scan

image ---

Source: APP PE Hyperledger Cacti v2.0.0 - Static Application Assessment Report.odt

cc: @takeutak @izuru0 @outSH @petermetz

@jagpreetsinghsasan jagpreetsinghsasan added good-first-issue Good for newcomers Security Related to existing or potential security vulnerabilities Hacktoberfest Hacktoberfest participants are welcome to take a stab at issues marked with this label. good-first-issue-100-introductory Tests Anything related to tests be that automatic or manual, integration or unit, etc. P4 Priority 4: Low labels Oct 11, 2023
@ShatilKhan
Copy link

Hi @jagpreetsinghsasan
Please assign me this issue

@petermetz
Copy link
Member

@ShatilKhan All yours!

@outSH
Copy link
Contributor

outSH commented Oct 16, 2023

@petermetz @ShatilKhan

Similar issue occurs in openethereum test ledger as well: https://github.com/hyperledger/cacti/blob/main/packages/cactus-test-tooling/src/main/typescript/openethereum/openethereum-test-ledger.ts#L234

@ashnashahgrover
Copy link
Contributor

Can you assign me this issue.

ashnashahgrover added a commit to ashnashahgrover/cacti that referenced this issue Jul 22, 2024
Primary Changes
----------------
1. Updated line 236 in openethereum-test-ledger.ts so the default password argument to the newEthPersonalAccount function is not hardcoded.

Fixes hyperledger#2766

Signed-off-by: ashnashahgrover <[email protected]>
@ashnashahgrover ashnashahgrover linked a pull request Jul 22, 2024 that will close this issue
5 tasks
ashnashahgrover added a commit to ashnashahgrover/cacti that referenced this issue Aug 5, 2024
Primary Changes
----------------
1. Updated line 236 in openethereum-test-ledger.ts so the default password argument to the
newEthPersonalAccount function is not hardcoded.

Fixes hyperledger#2766

BREAKING CHANGE: A line exceeding 100 characters has been split into two lines.

Signed-off-by: ashnashahgrover <[email protected]>
ashnashahgrover added a commit to ashnashahgrover/cacti that referenced this issue Aug 5, 2024
Primary Changes
----------------
1. Updated line 236 in openethereum-test-ledger.ts so the default password argument to the
newEthPersonalAccount function is not hardcoded.

Fixes hyperledger#2766

BREAKING CHANGE: A line exceeding 100 characters has been split into two lines.

Signed-off-by: ashnashahgrover <[email protected]>
ashnashahgrover added a commit to ashnashahgrover/cacti that referenced this issue Aug 11, 2024
Primary Changes
----------------
1. Updated line 236 in openethereum-test-ledger.ts so the default password argument to the
newEthPersonalAccount function is not hardcoded.

Fixes hyperledger#2766

BREAKING CHANGE: "password" is now a mandatory parameter of the newEthPersonalAccount function
defined in openethereum-test-ledger.ts. It was previously optional.

Signed-off-by: ashnashahgrover <[email protected]>
ashnashahgrover added a commit to ashnashahgrover/cacti that referenced this issue Aug 12, 2024
Primary Changes
----------------
1. BREAKING CHANGE: "password" is now a mandatory parameter of the newEthPersonalAccount function
defined in openethereum-test-ledger.ts. It was previously optional.
2. Updated line 236 in openethereum-test-ledger.ts so the default password argument to the
newEthPersonalAccount function is not hardcoded.

Fixes hyperledger#2766

Signed-off-by: ashnashahgrover <[email protected]>
ashnashahgrover added a commit to ashnashahgrover/cacti that referenced this issue Sep 3, 2024
Primary Changes
----------------
1. BREAKING CHANGE: "password" is now a mandatory parameter of the newEthPersonalAccount function
defined in openethereum-test-ledger.ts. It was previously optional.
2. Updated line 236 in openethereum-test-ledger.ts so the default password argument to the
newEthPersonalAccount function is not hardcoded.

Fixes hyperledger#2766

Signed-off-by: ashnashahgrover <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue Good for newcomers good-first-issue-100-introductory Hacktoberfest Hacktoberfest participants are welcome to take a stab at issues marked with this label. P4 Priority 4: Low Security Related to existing or potential security vulnerabilities Tests Anything related to tests be that automatic or manual, integration or unit, etc.
Projects
Status: In review
Development

Successfully merging a pull request may close this issue.

5 participants