Skip to content

Commit 6e2432e

Browse files
committed
Merge CORS source classes
1 parent 83cb788 commit 6e2432e

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

javascript/ql/lib/semmle/javascript/security/dataflow/CorsMisconfigurationForCredentialsCustomizations.qll

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,24 +68,17 @@ module CorsMisconfigurationForCredentials {
6868
/**
6969
* A value that is or coerces to the string "null".
7070
* This is considered a source because the "null" origin is easy to obtain for an attacker.
71+
* An overly permissive value for `origin`
7172
*/
72-
class NullToStringValue extends Source {
73-
NullToStringValue() {
73+
class PermissiveCorsOriginValue extends Source {
74+
PermissiveCorsOriginValue() {
75+
this.mayHaveStringValue("*") or
76+
this.mayHaveBooleanValue(true) or
7477
this.asExpr() instanceof NullLiteral or
75-
this.asExpr().mayHaveStringValue("null")
78+
this.asExpr().getStringValue() = "null"
7679
}
7780
}
7881

79-
/** An overly permissive value for `origin` (Apollo) */
80-
class TrueNullValue extends Source {
81-
TrueNullValue() { this.mayHaveBooleanValue(true) or this.asExpr() instanceof NullLiteral }
82-
}
83-
84-
/** An overly permissive value for `origin` (Express) */
85-
class WildcardValue extends Source {
86-
WildcardValue() { this.mayHaveStringValue("*") }
87-
}
88-
8982
/**
9083
* The value of cors origin configuration.
9184
*/

0 commit comments

Comments
 (0)