Skip to content

Commit 9f3fd57

Browse files
committed
Merge branch 'main' into cwe497b
2 parents e377eeb + b91914b commit 9f3fd57

File tree

381 files changed

+25584
-3523
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

381 files changed

+25584
-3523
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ If you have an idea for a query that you would like to share with other CodeQL u
3636

3737
For details, see the [guide on query metadata](docs/query-metadata-style-guide.md).
3838

39-
Make sure the `select` statement is compatible with the query `@kind`. See [About CodeQL queries](https://help.semmle.com/QL/learn-ql/writing-queries/introduction-to-queries.html#select-clause) on help.semmle.com.
39+
Make sure the `select` statement is compatible with the query `@kind`. See [About CodeQL queries](https://codeql.github.com/docs/writing-codeql-queries/about-codeql-queries/#select-clause) on codeql.github.com.
4040

4141
3. **Formatting**
4242

config/identical-files.json

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl3.qll",
2828
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl4.qll",
2929
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl.qll",
30-
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl2.qll"
30+
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl2.qll",
31+
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplForLibraries.qll"
3132
],
3233
"DataFlow Java/C++/C#/Python Common": [
3334
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplCommon.qll",
@@ -54,7 +55,8 @@
5455
"python/ql/lib/semmle/python/dataflow/new/internal/tainttracking2/TaintTrackingImpl.qll",
5556
"python/ql/lib/semmle/python/dataflow/new/internal/tainttracking3/TaintTrackingImpl.qll",
5657
"python/ql/lib/semmle/python/dataflow/new/internal/tainttracking4/TaintTrackingImpl.qll",
57-
"ruby/ql/lib/codeql/ruby/dataflow/internal/tainttracking1/TaintTrackingImpl.qll"
58+
"ruby/ql/lib/codeql/ruby/dataflow/internal/tainttracking1/TaintTrackingImpl.qll",
59+
"ruby/ql/lib/codeql/ruby/dataflow/internal/tainttrackingforlibraries/TaintTrackingImpl.qll"
5860
],
5961
"DataFlow Java/C++/C#/Python Consistency checks": [
6062
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplConsistency.qll",
@@ -480,11 +482,12 @@
480482
"python/ql/lib/semmle/python/security/performance/ReDoSUtil.qll",
481483
"ruby/ql/lib/codeql/ruby/security/performance/ReDoSUtil.qll"
482484
],
483-
"ReDoS Exponential Python/JS": [
485+
"ReDoS Exponential Python/JS/Ruby": [
484486
"javascript/ql/lib/semmle/javascript/security/performance/ExponentialBackTracking.qll",
485-
"python/ql/lib/semmle/python/security/performance/ExponentialBackTracking.qll"
487+
"python/ql/lib/semmle/python/security/performance/ExponentialBackTracking.qll",
488+
"ruby/ql/lib/codeql/ruby/security/performance/ExponentialBackTracking.qll"
486489
],
487-
"ReDoS Polynomial Python/JS": [
490+
"ReDoS Polynomial Python/JS/Ruby": [
488491
"javascript/ql/lib/semmle/javascript/security/performance/SuperlinearBackTracking.qll",
489492
"python/ql/lib/semmle/python/security/performance/SuperlinearBackTracking.qll",
490493
"ruby/ql/lib/codeql/ruby/security/performance/SuperlinearBackTracking.qll"
@@ -515,5 +518,35 @@
515518
"java/ql/lib/semmle/code/java/dataflow/internal/AccessPathSyntax.qll",
516519
"javascript/ql/lib/semmle/javascript/frameworks/data/internal/AccessPathSyntax.qll",
517520
"ruby/ql/lib/codeql/ruby/dataflow/internal/AccessPathSyntax.qll"
521+
],
522+
"Concepts Python/Ruby/JS": [
523+
"python/ql/lib/semmle/python/internal/ConceptsShared.qll",
524+
"ruby/ql/lib/codeql/ruby/internal/ConceptsShared.qll",
525+
"javascript/ql/lib/semmle/javascript/internal/ConceptsShared.qll"
526+
],
527+
"Hostname Regexp queries": [
528+
"javascript/ql/src/Security/CWE-020/HostnameRegexpShared.qll",
529+
"python/ql/src/Security/CWE-020/HostnameRegexpShared.qll",
530+
"ruby/ql/src/queries/security/cwe-020/HostnameRegexpShared.qll"
531+
],
532+
"ApiGraphModels": [
533+
"javascript/ql/lib/semmle/javascript/frameworks/data/internal/ApiGraphModels.qll",
534+
"ruby/ql/lib/codeql/ruby/frameworks/data/internal/ApiGraphModels.qll"
535+
],
536+
"TaintedFormatStringQuery Ruby/JS": [
537+
"javascript/ql/lib/semmle/javascript/security/dataflow/TaintedFormatStringQuery.qll",
538+
"ruby/ql/lib/codeql/ruby/security/TaintedFormatStringQuery.qll"
539+
],
540+
"TaintedFormatStringCustomizations Ruby/JS": [
541+
"javascript/ql/lib/semmle/javascript/security/dataflow/TaintedFormatStringCustomizations.qll",
542+
"ruby/ql/lib/codeql/ruby/security/TaintedFormatStringCustomizations.qll"
543+
],
544+
"HttpToFileAccessQuery JS/Ruby": [
545+
"javascript/ql/lib/semmle/javascript/security/dataflow/HttpToFileAccessQuery.qll",
546+
"ruby/ql/lib/codeql/ruby/security/HttpToFileAccessQuery.qll"
547+
],
548+
"HttpToFileAccessCustomizations JS/Ruby": [
549+
"javascript/ql/lib/semmle/javascript/security/dataflow/HttpToFileAccessCustomizations.qll",
550+
"ruby/ql/lib/codeql/ruby/security/HttpToFileAccessCustomizations.qll"
518551
]
519-
}
552+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: feature
3+
---
4+
* The data flow and taint tracking libraries have been extended with versions of `isBarrierIn`, `isBarrierOut`, and `isBarrierGuard`, respectively `isSanitizerIn`, `isSanitizerOut`, and `isSanitizerGuard`, that support flow states.

cpp/ql/lib/semmle/code/cpp/Location.qll

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,24 @@ class Location extends @location {
7373

7474
/** Holds if `this` comes on a line strictly before `l`. */
7575
pragma[inline]
76-
predicate isBefore(Location l) {
77-
this.getFile() = l.getFile() and this.getEndLine() < l.getStartLine()
76+
predicate isBefore(Location l) { this.isBefore(l, false) }
77+
78+
/**
79+
* Holds if `this` comes strictly before `l`. The boolean `sameLine` is
80+
* true if `l` is on the same line as `this`, but starts at a later column.
81+
* Otherwise, `sameLine` is false.
82+
*/
83+
pragma[inline]
84+
predicate isBefore(Location l, boolean sameLine) {
85+
this.getFile() = l.getFile() and
86+
(
87+
sameLine = false and
88+
this.getEndLine() < l.getStartLine()
89+
or
90+
sameLine = true and
91+
this.getEndLine() = l.getStartLine() and
92+
this.getEndColumn() < l.getStartColumn()
93+
)
7894
}
7995

8096
/** Holds if location `l` is completely contained within this one. */

cpp/ql/lib/semmle/code/cpp/Type.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ class Type extends Locatable, @type {
9494
* The result of this predicate will be the type itself, except in the case of a TypedefType or a Decltype,
9595
* in which case the result will be type which results from (possibly recursively) resolving typedefs.
9696
*/
97+
pragma[nomagic]
9798
Type getUnderlyingType() { result = this }
9899

99100
/**

0 commit comments

Comments
 (0)