Skip to content

Commit e4a75b4

Browse files
committed
JS: Autoformat
1 parent 8542c71 commit e4a75b4

File tree

5 files changed

+50
-46
lines changed

5 files changed

+50
-46
lines changed

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

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -313,26 +313,26 @@ module TaintTracking {
313313
cached
314314
private module Cached {
315315
/**
316-
* Holds if `pred` → `succ` should be considered a taint-propagating
317-
* data flow edge, which doesn't fit into a more specific category.
318-
*/
316+
* Holds if `pred` → `succ` should be considered a taint-propagating
317+
* data flow edge, which doesn't fit into a more specific category.
318+
*/
319319
cached
320320
predicate genericStep(DataFlow::Node pred, DataFlow::Node succ) {
321321
any(SharedTaintStep step).step(pred, succ)
322322
}
323323

324324
/**
325-
* Holds if `pred` → `succ` should be considered a taint-propagating
326-
* data flow edge, contribued by the heuristics library.
327-
*/
325+
* Holds if `pred` → `succ` should be considered a taint-propagating
326+
* data flow edge, contribued by the heuristics library.
327+
*/
328328
cached
329329
predicate heuristicStep(DataFlow::Node pred, DataFlow::Node succ) {
330330
any(SharedTaintStep step).heuristicStep(pred, succ)
331331
}
332332

333333
/**
334-
* Holds if `pred -> succ` is an edge contributed by an `AdditionalTaintStep` instance.
335-
*/
334+
* Holds if `pred -> succ` is an edge contributed by an `AdditionalTaintStep` instance.
335+
*/
336336
cached
337337
predicate legacyAdditionalTaintStep(DataFlow::Node pred, DataFlow::Node succ) {
338338
any(AdditionalTaintStep step).step(pred, succ)
@@ -344,96 +344,97 @@ module TaintTracking {
344344
cached
345345
module Public {
346346
/**
347-
* Holds if `pred` → `succ` should be considered a taint-propagating
348-
* data flow edge through a URI library function.
349-
*/
347+
* Holds if `pred` → `succ` should be considered a taint-propagating
348+
* data flow edge through a URI library function.
349+
*/
350350
cached
351351
predicate uriStep(DataFlow::Node pred, DataFlow::Node succ) {
352352
any(SharedTaintStep step).uriStep(pred, succ)
353353
}
354354

355355
/**
356-
* Holds if `pred -> succ` is a taint propagating data flow edge through persistent storage.
357-
*/
356+
* Holds if `pred -> succ` is a taint propagating data flow edge through persistent storage.
357+
*/
358358
cached
359359
predicate persistentStorageStep(DataFlow::Node pred, DataFlow::Node succ) {
360360
any(SharedTaintStep step).persistentStorageStep(pred, succ)
361361
}
362362

363363
/**
364-
* Holds if `pred -> succ` is a taint propagating data flow edge through the heap.
365-
*/
364+
* Holds if `pred -> succ` is a taint propagating data flow edge through the heap.
365+
*/
366366
cached
367367
predicate heapStep(DataFlow::Node pred, DataFlow::Node succ) {
368368
any(SharedTaintStep step).heapStep(pred, succ)
369369
}
370370

371371
/**
372-
* Holds if `pred -> succ` is a taint propagating data flow edge through an array.
373-
*/
372+
* Holds if `pred -> succ` is a taint propagating data flow edge through an array.
373+
*/
374374
cached
375375
predicate arrayStep(DataFlow::Node pred, DataFlow::Node succ) {
376376
any(SharedTaintStep step).arrayStep(pred, succ)
377377
}
378378

379379
/**
380-
* Holds if `pred -> succ` is a taint propagating data flow edge through the
381-
* properties of a view compenent, such as the `state` or `props` of a React component.
382-
*/
380+
* Holds if `pred -> succ` is a taint propagating data flow edge through the
381+
* properties of a view compenent, such as the `state` or `props` of a React component.
382+
*/
383383
cached
384384
predicate viewComponentStep(DataFlow::Node pred, DataFlow::Node succ) {
385385
any(SharedTaintStep step).viewComponentStep(pred, succ)
386386
}
387387

388388
/**
389-
* Holds if `pred -> succ` is a taint propagating data flow edge through string
390-
* concatenation.
391-
*/
389+
* Holds if `pred -> succ` is a taint propagating data flow edge through string
390+
* concatenation.
391+
*/
392392
cached
393393
predicate stringConcatenationStep(DataFlow::Node pred, DataFlow::Node succ) {
394394
any(SharedTaintStep step).stringConcatenationStep(pred, succ)
395395
}
396396

397397
/**
398-
* Holds if `pred -> succ` is a taint propagating data flow edge through string manipulation
399-
* (other than concatenation).
400-
*/
398+
* Holds if `pred -> succ` is a taint propagating data flow edge through string manipulation
399+
* (other than concatenation).
400+
*/
401401
cached
402402
predicate stringManipulationStep(DataFlow::Node pred, DataFlow::Node succ) {
403403
any(SharedTaintStep step).stringManipulationStep(pred, succ)
404404
}
405405

406406
/**
407-
* Holds if `pred` → `succ` should be considered a taint-propagating
408-
* data flow edge through data serialization, such as `JSON.stringify`.
409-
*/
407+
* Holds if `pred` → `succ` should be considered a taint-propagating
408+
* data flow edge through data serialization, such as `JSON.stringify`.
409+
*/
410410
cached
411411
predicate serializeStep(DataFlow::Node pred, DataFlow::Node succ) {
412412
any(SharedTaintStep step).serializeStep(pred, succ)
413413
}
414414

415415
/**
416-
* Holds if `pred` → `succ` should be considered a taint-propagating
417-
* data flow edge through data deserialization, such as `JSON.parse`.
418-
*/
416+
* Holds if `pred` → `succ` should be considered a taint-propagating
417+
* data flow edge through data deserialization, such as `JSON.parse`.
418+
*/
419419
cached
420420
predicate deserializeStep(DataFlow::Node pred, DataFlow::Node succ) {
421421
any(SharedTaintStep step).deserializeStep(pred, succ)
422422
}
423423

424424
/**
425-
* Holds if `pred` → `succ` should be considered a taint-propagating
426-
* data flow edge through a promise.
427-
*
428-
* These steps consider a promise object to tainted if it can resolve to
429-
* a tainted value.
430-
*/
425+
* Holds if `pred` → `succ` should be considered a taint-propagating
426+
* data flow edge through a promise.
427+
*
428+
* These steps consider a promise object to tainted if it can resolve to
429+
* a tainted value.
430+
*/
431431
cached
432432
predicate promiseStep(DataFlow::Node pred, DataFlow::Node succ) {
433433
any(SharedTaintStep step).promiseStep(pred, succ)
434434
}
435435
}
436436
}
437+
437438
import Cached::Public
438439

439440
/**

javascript/ql/src/semmle/javascript/frameworks/AsyncPackage.qll

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,14 @@ module AsyncPackage {
168168
*/
169169
private class IterationOutputTaintStep extends TaintTracking::SharedTaintStep {
170170
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
171-
exists(DataFlow::FunctionNode iteratee, DataFlow::FunctionNode final, int i, IterationCall call |
171+
exists(
172+
DataFlow::FunctionNode iteratee, DataFlow::FunctionNode final, int i, IterationCall call
173+
|
172174
iteratee = call.getIteratorCallback().getALocalSource() and
173175
final = call.getFinalCallback() and // Require a closure to avoid spurious call/return mismatch.
174176
pred = getLastParameter(iteratee).getACall().getArgument(i) and
175177
succ = final.getParameter(i) and
176-
exists (string name | name = call.getName() |
178+
exists(string name | name = call.getName() |
177179
name = "concat" or
178180
name = "map" or
179181
name = "reduce" or

javascript/ql/src/semmle/javascript/frameworks/UriLibraries.qll

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import javascript
99
*
1010
* A taint propagating data flow edge arising from an operation in a URI library.
1111
*/
12-
deprecated abstract class UriLibraryStep extends DataFlow::ValueNode, TaintTracking::AdditionalTaintStep { }
12+
abstract deprecated class UriLibraryStep extends DataFlow::ValueNode,
13+
TaintTracking::AdditionalTaintStep { }
1314

1415
/**
1516
* Provides classes for working with [urijs](http://medialize.github.io/URI.js/) code.
@@ -298,7 +299,9 @@ private module ClosureLibraryUri {
298299
*/
299300
private class ArgumentStep extends TaintTracking::SharedTaintStep {
300301
override predicate uriStep(DataFlow::Node pred, DataFlow::Node succ) {
301-
exists(DataFlow::InvokeNode invoke, int arg | pred = invoke.getArgument(arg) and succ = invoke |
302+
exists(DataFlow::InvokeNode invoke, int arg |
303+
pred = invoke.getArgument(arg) and succ = invoke
304+
|
302305
// goog.Uri constructor
303306
invoke = Closure::moduleImport("goog.Uri").getAnInstantiation() and arg = 0
304307
or

javascript/ql/src/semmle/javascript/heuristics/AdditionalTaintSteps.qll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ import javascript
1212
* The target of a heuristic additional flow step in a security query.
1313
*/
1414
deprecated class HeuristicAdditionalTaintStep extends DataFlow::Node {
15-
HeuristicAdditionalTaintStep() {
16-
any(TaintTracking::SharedTaintStep step).heuristicStep(_, this)
17-
}
15+
HeuristicAdditionalTaintStep() { any(TaintTracking::SharedTaintStep step).heuristicStep(_, this) }
1816
}
1917

2018
/**

javascript/ql/src/semmle/javascript/security/dataflow/Xss.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ module DomBasedXss {
338338
/**
339339
* A Vue `v-html` attribute, viewed as an XSS sink.
340340
*/
341-
class VHtmlSink extends Vue::VHtmlAttribute, DomBasedXss::Sink {}
341+
class VHtmlSink extends Vue::VHtmlAttribute, DomBasedXss::Sink { }
342342

343343
/**
344344
* A property read from a safe property is considered a sanitizer.

0 commit comments

Comments
 (0)