Adding Membership.GeneratePassword() as a bad source of random data because of the bias.

This commit is contained in:
Raul Garcia (MSFT)
2021-08-04 17:12:00 -07:00
parent 6a09a5667d
commit 8544356f90
2 changed files with 7 additions and 1 deletions

View File

@@ -59,6 +59,12 @@ module Random {
this.getExpr() =
any(MethodCall mc |
mc.getQualifier().getType().(RefType).hasQualifiedName("System", "Random")
or
// by using `% 87` on a `byte`, this function has a bias
mc.getQualifier()
.getType()
.(RefType)
.hasQualifiedName("System.Web.Security", "GeneratePassword")
)
}
}