Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c4d1aff

Browse files
committed
Python: Suggestions from reviewer
1 parent 1516775 commit c4d1aff

3 files changed

Lines changed: 20 additions & 20 deletions

File tree

python/ql/src/experimental/Security-new-dataflow/CWE-022/ChainedConfigs12.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ private predicate crossoverNode(DataFlow::Node n) {
2424
*/
2525
private newtype TCustomPathNode =
2626
Config1Node(DataFlow::PathNode node1) { not crossoverNode(node1.getNode()) } or
27-
Config2Node(DataFlow2::PathNode node1) { not crossoverNode(node1.getNode()) } or
28-
CrossoverNode(DataFlow::Node e) { crossoverNode(e) }
27+
Config2Node(DataFlow2::PathNode node2) { not crossoverNode(node2.getNode()) } or
28+
CrossoverNode(DataFlow::Node node) { crossoverNode(node) }
2929

3030
/**
3131
* A class representing the set of all the path nodes in either config.

python/ql/src/experimental/Security-new-dataflow/CWE-022/PathInjection.ql

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
/**
2+
* @name Uncontrolled data used in path expression
3+
* @description Accessing paths influenced by users can allow an attacker to access unexpected resources.
4+
* @kind path-problem
5+
* @problem.severity error
6+
* @sub-severity high
7+
* @precision high
8+
* @id py/path-injection
9+
* @tags correctness
10+
* security
11+
* external/owasp/owasp-a1
12+
* external/cwe/cwe-022
13+
* external/cwe/cwe-023
14+
* external/cwe/cwe-036
15+
* external/cwe/cwe-073
16+
* external/cwe/cwe-099
17+
*
218
* The query detects cases where a user-controlled path is used in an unsafe manner,
319
* meaning it is not both normalized and _afterwards_ checked.
420
*
@@ -7,7 +23,7 @@
723
* This is easily detected by using normalization as a sanitizer.
824
*
925
* 2. The file path is normalized at least once, but never checked afterwards.
10-
* This is detected by finding the earliest normalization and then ensure that
26+
* This is detected by finding the earliest normalization and then ensuring that
1127
* no checks happen later. Since we start from the earliest normalization,
1228
* we know that the absence of checks means that no normalization has a
1329
* check after it. (No checks after a second normalization would be ok if
@@ -18,22 +34,6 @@
1834
* as a `Sanitizer`. That means that only some dataflow paths out of a check will be removed,
1935
* and so identifying the last check is not possible simply by finding a dataflow path from it
2036
* to a sink.
21-
*
22-
* @name Uncontrolled data used in path expression
23-
* @description Accessing paths influenced by users can allow an attacker to access unexpected resources.
24-
* @kind path-problem
25-
* @problem.severity error
26-
* @sub-severity high
27-
* @precision high
28-
* @id py/path-injection
29-
* @tags correctness
30-
* security
31-
* external/owasp/owasp-a1
32-
* external/cwe/cwe-022
33-
* external/cwe/cwe-023
34-
* external/cwe/cwe-036
35-
* external/cwe/cwe-073
36-
* external/cwe/cwe-099
3737
*/
3838

3939
import python

python/ql/src/experimental/semmle/python/Concepts.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ module Path {
8686
/** Provides a class for modeling new path normalization APIs. */
8787
module PathNormalization {
8888
/**
89-
* A data-flow node that performs path normlization. This is often needed in oder
89+
* A data-flow node that performs path normalization. This is often needed in order
9090
* to safely access paths.
9191
*/
9292
abstract class Range extends DataFlow::Node { }

0 commit comments

Comments
 (0)