Skip to content

Commit 30d5eb5

Browse files
committed
update docstrings
1 parent ffc6fdd commit 30d5eb5

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

javascript/ql/src/semmle/javascript/dataflow/TaintTracking.qll

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -650,10 +650,11 @@ module TaintTracking {
650650
/**
651651
* Holds if `pred` should be stored in the object `succ` under the property `prop`.
652652
*
653-
* This step is used to model 2 facts:
654-
* 1) A `URL` constructed using `url = new URL(input)` transfers taint from `input` to `url.searchParams`.
655-
* 2) A `URLSearchParams` (either `url.searchParams` or `new URLSearchParams(input)`) has a tainted value,
656-
* which is stored in a pseudo-property, that can later be access using a `get` or `getAll` call.
653+
* This step is used to model 3 facts:
654+
* 1) A `URL` constructed using `url = new URL(input)` transfers taint from `input` to `url.searchParams`. (See prop = "searchParams")
655+
* 2) Accessing the `searchParams` on a `URL` results in a `URLSearchParams` object (See the loadStoreStep method on this class and hiddenUrlPseudoProperty())
656+
* 3) A `URLSearchParams` object (either `url.searchParams` or `new URLSearchParams(input)`) has a tainted value,
657+
* which can be accessed using a `get` or `getAll` call. (See getableUrlPseudoProperty())
657658
*/
658659
override predicate storeStep(DataFlow::Node pred, DataFlow::Node succ, string prop) {
659660
(prop = "searchParams" or prop = hiddenUrlPseudoProperty()) and
@@ -670,6 +671,7 @@ module TaintTracking {
670671
* Holds if the property `loadStep` should be copied from the object `pred` to the property `storeStep` of object `succ`.
671672
*
672673
* This step is used to copy the value of our pseudo-property that can later be accessed using a `get` or `getAll` call.
674+
* For an expression `url.searchParams`, the property `hiddenUrlPseudoProperty()` from the `url` object is stored in the property `getableUrlPseudoProperty()` on `url.searchParams`.
673675
*/
674676
override predicate loadStoreStep(DataFlow::Node pred, DataFlow::Node succ, string loadProp, string storeProp) {
675677
loadProp = hiddenUrlPseudoProperty() and
@@ -683,7 +685,7 @@ module TaintTracking {
683685
/**
684686
* Holds if the property `prop` of the object `pred` should be loaded into `succ`.
685687
*
686-
* This step is used to load the value stored in the hidden pseudo-property.
688+
* This step is used to load the value stored in the pseudo-property `getableUrlPseudoProperty()`.
687689
*/
688690
override predicate loadStep(DataFlow::Node pred, DataFlow::Node succ, string prop) {
689691
prop = getableUrlPseudoProperty() and

0 commit comments

Comments
 (0)