Skip to content

Commit 222ac68

Browse files
committed
python/javascript: add qldoc
1 parent 9bfa6ae commit 222ac68

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

javascript/ql/lib/semmle/javascript/dataflow/internal/BarrierGuards.qll

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ module MakeBarrierGuard<BarrierGuardSig BaseGuard> {
3636
}
3737
}
3838

39+
/**
40+
* Provides access to barrier guards defined via models-as-data.
41+
*/
3942
module ExternalBarrierGuard {
4043
private predicate guardCheck(DataFlow::Node g, Expr e, boolean branch, string kind) {
4144
exists(API::CallNode call, API::Node parameter |
@@ -47,14 +50,17 @@ module ExternalBarrierGuard {
4750
)
4851
}
4952

50-
class BarrierGuard extends DataFlow::Node {
53+
private class BarrierGuard extends DataFlow::Node {
5154
BarrierGuard() { guardCheck(this, _, _, _) }
5255

5356
predicate blocksExpr(boolean outcome, Expr e, string kind) {
5457
guardCheck(this, e, outcome, kind)
5558
}
5659
}
5760

61+
/**
62+
* Gets a barrier guard node of the given `kind` defined via models-as-data.
63+
*/
5864
DataFlow::Node getAnExternalBarrierNode(string kind) {
5965
result = MakeStateBarrierGuard<string, BarrierGuard>::getABarrierNode(kind)
6066
}

python/ql/lib/semmle/python/security/dataflow/UrlRedirectCustomizations.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ module UrlRedirect {
161161
/** DEPRECATED: Use ConstCompareAsSanitizerGuard instead. */
162162
deprecated class StringConstCompareAsSanitizerGuard = ConstCompareAsSanitizerGuard;
163163

164+
/**
165+
* A sanitizer defined via models-as-data with kind "url-redirection".
166+
*/
164167
class SanitizerFromModel extends Sanitizer {
165168
SanitizerFromModel() {
166169
this = DataFlow::ExternalBarrierGuard::getAnExternalBarrierNode("url-redirection")

0 commit comments

Comments
 (0)