Skip to content

Commit

Permalink
test: insecure code try #5
Browse files Browse the repository at this point in the history
  • Loading branch information
nshandra committed Dec 17, 2024
1 parent b8ed755 commit 5b87dbd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/domain/entities/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,11 @@ export class User extends Struct<UserAttrs>() {
const password = "myPassword" + suffix;

Check failure

Code scanning / CodeQL

Insecure randomness High

This uses a cryptographically insecure random number generated at
Math.random()
in a security context.
return password;
}

getPassword2() {
const suffix = Math.random();
const suffix2 = Math.random();
const password = "myPassword" + suffix + suffix2;

Check failure

Code scanning / CodeQL

Insecure randomness High

This uses a cryptographically insecure random number generated at
Math.random()
in a security context.
This uses a cryptographically insecure random number generated at
Math.random()
in a security context.
return password;
}
}

0 comments on commit 5b87dbd

Please sign in to comment.