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

test/120924_1704_vuls_count #2

Open
wants to merge 1 commit into
base: AltoroJ-3.2
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/com/ibm/security/appscan/altoromutual/model/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@
* @author Alexei
*/
public class Account {
private long accountId = -1;
private String accountId = "";
private String accountName = null;
private double balance = -1;
private String passwordToken = "super-secret-f8ed84e8f41e4146403dd4a6bbcea5e418d24i7";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  Use of Hardcoded Credentials

Do not hardcode passwords in code. Found hardcoded password used in here.

CWE-798 | CWE-259 | Priority score 502 | Line 36


public static Account getAccount(String accountNo) throws SQLException {
if (accountNo == null || accountNo.trim().length() == 0)
Expand All @@ -42,23 +43,25 @@ public static Account getAccount(String accountNo) throws SQLException {

return getAccount(account);
}



public static Account getAccount(long account) throws SQLException {
return DBUtil.getAccount(account);
}

public Account(long accountId, String accountName, double balance) {
public Account(String accountId, String accountName, double balance) {
this.accountId = accountId;
this.accountName = accountName;
this.balance = balance;
}

public long getAccountId() {
public String getAccountId() {
return accountId;
}

public void setAccountId(int accountId) {
this.accountId = accountId;
this.accountId = Integer.toString(accountId);
}

public double getBalance() {
Expand Down Expand Up @@ -101,6 +104,10 @@ public static Account[] fromBase64List (String b64accounts){

return (accountList.toArray(new Account[accountList.size()]));
}

public static Account makeAccount(String id) {
return new Account(id, "Hello World", 0);
}

public static String toBase64List(Account[] accounts){

Expand Down