Skip to content

Commit 272a097

Browse files
committed
Merge CORS source classes
1 parent 83cb788 commit 272a097

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

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

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,26 +66,17 @@ module CorsMisconfigurationForCredentials {
6666
}
6767

6868
/**
69-
* A value that is or coerces to the string "null".
70-
* This is considered a source because the "null" origin is easy to obtain for an attacker.
69+
* An overly permissive value for `origin`
7170
*/
72-
class NullToStringValue extends Source {
73-
NullToStringValue() {
71+
class PermissiveCorsOriginValue extends Source {
72+
PermissiveCorsOriginValue() {
73+
this.mayHaveStringValue("*") or
74+
this.mayHaveBooleanValue(true) or
7475
this.asExpr() instanceof NullLiteral or
7576
this.asExpr().mayHaveStringValue("null")
7677
}
7778
}
7879

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-
8980
/**
9081
* The value of cors origin configuration.
9182
*/

0 commit comments

Comments
 (0)