Merge pull request #2708 from asger-semmle/js/react-flow-through-imports · github/codeql@120b50f · GitHub
Skip to content

Commit 120b50f

Browse files
authored
Merge pull request #2708 from asger-semmle/js/react-flow-through-imports
Approved by esbena
2 parents d0ac846 + b306571 commit 120b50f

7 files changed

Lines changed: 62 additions & 3 deletions

File tree

‎javascript/ql/src/semmle/javascript/frameworks/React.qll‎

Lines changed: 38 additions & 3 deletions

‎javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ typeInferenceMismatch
5959
| exceptions.js:144:9:144:16 | source() | exceptions.js:132:8:132:27 | returnThrownSource() |
6060
| exceptions.js:150:13:150:20 | source() | exceptions.js:153:10:153:10 | e |
6161
| exceptions.js:158:13:158:20 | source() | exceptions.js:161:10:161:10 | e |
62+
| importedReactComponent.jsx:4:40:4:47 | source() | exportedReactComponent.jsx:2:10:2:19 | props.text |
6263
| indexOf.js:4:11:4:18 | source() | indexOf.js:9:10:9:10 | x |
6364
| partialCalls.js:4:17:4:24 | source() | partialCalls.js:17:14:17:14 | x |
6465
| partialCalls.js:4:17:4:24 | source() | partialCalls.js:20:14:20:14 | y |
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export function UnsafeReactComponent(props) {
2+
sink(props.text);
3+
return <div/>
4+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { UnsafeReactComponent } from "./exportedReactComponent";
2+
3+
export function render() {
4+
return <UnsafeReactComponent text={source()}/>
5+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function MyComponent(props) {
2+
return <div style={{color: props.color}}/>
3+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { MyComponent } from "./exportedComponent";
2+
3+
export function render(color) {
4+
return <MyComponent color={color}/>
5+
}

‎javascript/ql/test/library-tests/frameworks/ReactJS/tests.expected‎

Lines changed: 6 additions & 0 deletions

0 commit comments

Comments
 (0)