Skip to content

[Feature branch] JS: Migrate to shared dataflow library #14412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 226 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
226 commits
Select commit Hold shift + click to select a range
60b179b
Shared: add DeduplicatePathGraph
asgerf Oct 12, 2023
51ef0e5
JS: Move TNode into a cached module
asgerf Oct 3, 2023
79e7aae
JS: Add TEarlyStageNode
asgerf Oct 3, 2023
b499c60
JS: Add Contents.qll
asgerf Oct 3, 2023
21300ee
JS:Add ConstructorThisArgumentNode
asgerf Oct 3, 2023
01952f1
JS: Add some missing getContainer() predicates
asgerf Oct 3, 2023
c839822
JS: Add PostUpdateNode
asgerf Oct 10, 2023
3455463
JS: Add instantiation boilerplate
asgerf Oct 3, 2023
760873c
JS: Basic instantiation of shared library
asgerf Oct 9, 2023
f316da7
JS: Add FunctionSelfReferenceNode
asgerf Oct 10, 2023
8dc0800
JS: Add the shared FlowSummaryImpl.qll file
asgerf Oct 4, 2023
60101f5
JS: Instantiate flow summary library
asgerf Oct 4, 2023
32070ab
JS: Implicitly treat array steps as taint steps
asgerf Oct 4, 2023
293899d
JS: Add 'Awaited' token
asgerf Oct 4, 2023
5bccc65
JS: Move SharedFlowStep to AdditionalFlowSteps.qll
asgerf Oct 10, 2023
c24a0e0
JS: Move SharedTaintStep to AdditionalTaintSteps.qll
asgerf Oct 10, 2023
1afe06e
JS: Add "additional" and "legacy" steps
asgerf Oct 10, 2023
27c7d50
JS: Do the same for additional taint steps
asgerf Oct 10, 2023
6037ff5
JS: Add LegacyPreUpdateStep
asgerf Oct 10, 2023
3f20d71
JS: Add legacy post-update step
asgerf Oct 10, 2023
46fec8e
JS: Add AdditionalFlowInternal
asgerf Oct 10, 2023
a31e251
JS: Add flow summaries for core methods
asgerf Oct 3, 2023
4319b07
JS: Add flow summaries for Arrays
asgerf Oct 3, 2023
5054c43
JS: Add flow summaries/steps for promises and async/await
asgerf Oct 13, 2023
f0c2afe
JS: Add flow summaries for maps and sets
asgerf Oct 3, 2023
da3a0de
JS: Port String#replace to flow summary
asgerf Oct 3, 2023
0c2e52b
JS: Summary/steps for iterators and generators
asgerf Oct 3, 2023
e31ae3a
JS: Model JSON.stringify with "deep" read operators
asgerf Oct 3, 2023
9fef880
JS: Avoid BarrierGuardNode's range from depending on Configuration
asgerf Oct 4, 2023
3ef4786
JS: Collapse some cached stages
asgerf Oct 4, 2023
16df2c3
Create DataFlowImplConsistency.qll
asgerf Oct 4, 2023
7bcf8b8
JS: Capture flow
asgerf Oct 4, 2023
46e4cdc
JS: Disallow consecutive captured contents
asgerf Oct 6, 2023
06fd9c2
JS: Add barrier guard library
asgerf Oct 4, 2023
277292e
JS: Improve performance of barrier guards without pruning
asgerf Oct 12, 2023
1ed3235
JS: use BarrierGuards
asgerf Oct 4, 2023
c924b4a
JS: Expose shared API in DataFlow/TaintTracking modules
asgerf Oct 4, 2023
26f7f94
JS: Expose default taint steps/sanitizers
asgerf Oct 4, 2023
bc68b6a
JS: Add AdHocWhitelistSanitizer::getABarrierNode()
asgerf Oct 4, 2023
aa5a283
JS: Update barriers in TaintedObject
asgerf Oct 4, 2023
449ec72
JS: Port experimental queries
asgerf Oct 4, 2023
ccd6d3d
JS: Port example queries
asgerf Oct 4, 2023
17233a6
JS: Port CommandInjection
asgerf Oct 4, 2023
fcfab52
JS: Port CodeInjection
asgerf Oct 4, 2023
65e9706
JS: Port TaintedPath
asgerf Oct 4, 2023
547a8a9
JS: Port SqlInjection
asgerf Oct 4, 2023
2818fa6
JS: Updates to shared Xss.qll
asgerf Oct 4, 2023
e091fde
JS: Port DomBasedXss
asgerf Oct 4, 2023
46b90e5
JS: Port ReflectedXss
asgerf Oct 4, 2023
5f05232
JS: Port StoredXss
asgerf Oct 4, 2023
cf5450d
JS: Port XssThroughDom
asgerf Oct 4, 2023
d7b4e0c
JS: Port ExceptionXss
asgerf Oct 4, 2023
b221662
JS: Port RequestForgery
asgerf Oct 4, 2023
92816b1
JS: Port ClientSideRequestForgery
asgerf Oct 4, 2023
46fd727
JS: Port ServerSideUrlRedirect
asgerf Oct 4, 2023
81d2721
JS: Port ClientSideUrlRedirect
asgerf Oct 4, 2023
f1f4592
JS: Port PrototypePollutingAssignment
asgerf Oct 4, 2023
adf7d54
JS: Port PrototypePollutingFunction
asgerf Oct 4, 2023
a5c221f
JS: Port PrototypePollutingMergeCall
asgerf Oct 4, 2023
b8a6f81
JS: Port CleartextLogging
asgerf Oct 4, 2023
40d68cb
JS: Port CleartextStorage
asgerf Oct 4, 2023
ae680e7
JS: Port LoopBoundInjection
asgerf Oct 4, 2023
e9189f9
JS: Port LogInjection
asgerf Oct 4, 2023
7a1aead
JS: Port ZipSlip
asgerf Oct 4, 2023
395f523
JS: Port barriers in UrlConcatenation.qll
asgerf Oct 5, 2023
85617c2
JS: Port BrokenCryptoAlgorithm
asgerf Oct 5, 2023
2296a27
JS: Port BuildArtifactLeak
asgerf Oct 5, 2023
f14303a
JS: Port ConditionalBypass
asgerf Oct 5, 2023
30f1fbc
JS: Port CorsMisconfigurationForCredentials
asgerf Oct 5, 2023
d324e55
JS: Port DeepObjectResourceExhaustion
asgerf Oct 5, 2023
abd937a
JS: Port DifferentKindsComparisonBypass
asgerf Oct 5, 2023
8e95a90
JS: Port UntrustedDataToExternalAPI
asgerf Oct 5, 2023
2935aac
JS: Port FileAccessToHttp
asgerf Oct 5, 2023
f4d62c3
JS: Port HttpToFileAccess
asgerf Oct 5, 2023
4bac902
JS: Port HardcodedCredentials
asgerf Oct 5, 2023
bc88f50
JS: Port HardcodedDataInterpretedAsCode
asgerf Oct 5, 2023
8715c1b
JS: Port HostHeaderPoisoningInEmailGeneration
asgerf Oct 5, 2023
9128722
JS: Port ImproperCodeSanitization
asgerf Oct 5, 2023
e3ab5bd
JS: Port IncompleteHtmlAttributeSanitization
asgerf Oct 5, 2023
8c00191
JS: Port IndirectCommandInjection
asgerf Oct 5, 2023
99f63b1
JS: Port InsecureDownload
asgerf Oct 5, 2023
cd1a1e2
JS: Port InsecureRandomness
asgerf Oct 5, 2023
fd98b25
JS: Port InsecureTemporaryFile
asgerf Oct 5, 2023
e1fae3d
JS: Port InsufficientPasswordHash
asgerf Oct 5, 2023
2400af4
JS: Port PostMessageStar
asgerf Oct 5, 2023
dcc73a7
JS: Port RegExpInjection
asgerf Oct 5, 2023
b9bd052
JS: Port RemotePropertyInjection
asgerf Oct 5, 2023
4af7694
JS: Port ResourceExhaustion
asgerf Oct 5, 2023
06835a8
JS: Port SecondOrderCommandInjection
asgerf Oct 5, 2023
d446444
JS: Port ShellCommandInjectionFromEnvironment
asgerf Oct 5, 2023
63343b1
JS: Port StackTraceExposure
asgerf Oct 5, 2023
51624c0
JS: Port TaintedFormatString
asgerf Oct 5, 2023
25962a9
JS: Port TemplateObjectInjection
asgerf Oct 5, 2023
5af608c
JS: Port TypeConfusionThroughParameterTampering
asgerf Oct 5, 2023
32022cc
JS: Port UnsafeCodeConstruction
asgerf Oct 5, 2023
758f424
JS: Port UnsafeDeserialization
asgerf Oct 5, 2023
7f4d42d
JS: Port UnsafeDynamicMethodAccess
asgerf Oct 5, 2023
6e3f4bd
JS: Port UnsafeHtmlConstruction
asgerf Oct 5, 2023
d08e450
JS: Port UnsafeJQueryPlugin
asgerf Oct 5, 2023
ba9edb4
JS: Port UnsafeShellCommandConstruction
asgerf Oct 5, 2023
8309553
JS: Port UnvalidatedDynamicMethodCall
asgerf Oct 5, 2023
03f8c0f
JS: Port XmlBomb
asgerf Oct 5, 2023
c2d170b
JS: Port XpathInjection
asgerf Oct 5, 2023
b8847db
JS: Port Xxe
asgerf Oct 5, 2023
c55300d
JS: Port PolynomialReDoS
asgerf Oct 5, 2023
43be452
JS: Port meta queries
asgerf Oct 5, 2023
d35959a
JS: Add utility for comparing results in tests
asgerf Oct 5, 2023
ff08637
JS: Port Arrays test
asgerf Oct 5, 2023
9a15a55
JS: Port SimpleBarrierGuard test
asgerf Oct 5, 2023
1a95961
JS: Port Classes test
asgerf Oct 5, 2023
c652470
JS: Do not port CustomLoadStoreStep test
asgerf Oct 5, 2023
af05789
JS: Remove noise from data flow test
asgerf Oct 9, 2023
92812ee
JS: Add test for flow summaries
asgerf Oct 5, 2023
09b0ba0
JS: Port Angular2 test
asgerf Oct 5, 2023
466ffdf
JS: Port AsyncTaintTracking test
asgerf Oct 5, 2023
0989227
JS: Port Collections test
asgerf Oct 5, 2023
6600fe9
JS: Port ComposedFunctions test
asgerf Oct 5, 2023
a2d4a03
JS: Update framework/data test
asgerf Oct 6, 2023
644f968
JS: Update frameworks/immutable test
asgerf Oct 6, 2023
2eec47b
JS: Update frameworks/Next test
asgerf Oct 6, 2023
d205344
JS: Update frameworks/PropertyProjection test
asgerf Oct 6, 2023
b934413
JS: Update Redux test
asgerf Oct 6, 2023
3983530
JS: Update Templating/Xss test
asgerf Oct 6, 2023
995df41
JS: Update Vuex test
asgerf Oct 6, 2023
9372f79
JS: Update Generators test
asgerf Oct 6, 2023
50aace3
JS: Add global post-update steps
asgerf Oct 6, 2023
0d10aba
Revert "JS: Add global post-update steps"
asgerf Oct 6, 2023
458f0a0
JS: Port InterProceduralFlow test
asgerf Oct 6, 2023
dd8a24c
JS: Port LabelledBarrierGuards test
asgerf Oct 6, 2023
81bd292
JS: Port Promises test
asgerf Oct 6, 2023
98d1bb3
JS: Reorder result sets in a test (trivial change)
asgerf Oct 6, 2023
2364bd8
JS: Fix whitespace in a test (trivial change)
asgerf Oct 6, 2023
771519b
JS: Port Routing test
asgerf Oct 6, 2023
e5946bf
JS: Port HeuristicSource test
asgerf Oct 6, 2023
6c9f4a1
JS: Port TaintBarriers test
asgerf Oct 6, 2023
b8a0afb
JS: Make overriding ConsistencyChecking.getATestFile() optional
asgerf Oct 6, 2023
32eddd3
JS: Update ReactJS test output
asgerf Oct 6, 2023
b304fb4
JS: Reorder result sets in ReactJS test output
asgerf Oct 6, 2023
c2f66c0
JS: Update Restify2 test
asgerf Oct 6, 2023
75c915b
JS: Update Spife test
asgerf Oct 6, 2023
b5ad366
JS: Block flow into window.location
asgerf Oct 6, 2023
2eff07f
JS: Update TaintTracking test
asgerf Oct 6, 2023
85e8998
JS: Update ImportEquals test
asgerf Oct 6, 2023
bab639f
JS: Update ReflectedXssWithCustomSanitizer test
asgerf Oct 6, 2023
9b46c45
JS: Update HeuristicSoruceCodeInjection test
asgerf Oct 6, 2023
98c79e7
JS: Update test output showing lack of global flow (geniune FN)
asgerf Oct 9, 2023
7c5eb89
JS: Add tests for captured 'this' (genuine FN)
asgerf Oct 9, 2023
24bab27
JS: Add TODO for dynamic import step
asgerf Oct 4, 2023
51dec79
JS: Lower access path limit to 2
asgerf Oct 6, 2023
d3f5169
JS: Lower field-flow branch limit on Polynomial ReDoS
asgerf Oct 6, 2023
e738b5d
JS: Expand callback test case
asgerf Oct 10, 2023
9faf300
JS: Use type-pruning to restrict callback flow
asgerf Oct 10, 2023
5775fe6
JS: Use TAnyType in FlowSummaryPrivate
asgerf Oct 13, 2023
3c7c537
JS: Add content approximation
asgerf Oct 10, 2023
a02ab2a
JS: Port heuristic versions of standard queries
asgerf Oct 11, 2023
f94aa2c
Update javascript/ql/lib/semmle/javascript/dataflow/internal/DataFlow…
asgerf Mar 12, 2024
28fc8ba
JS: Remove EmptyType
asgerf Mar 12, 2024
76e0445
JS: Be consistent about caching in PreCallGraphStep
asgerf Mar 12, 2024
5aafd33
JS: Rename Arrays2 -> Arrays
asgerf Mar 12, 2024
b3fad7a
JS: Rename Iterators2 -> Iterators
asgerf Mar 12, 2024
e2f3565
JS: Rename Maps2 -> Maps
asgerf Mar 12, 2024
4334894
JS: Rename Promise2 -> Promise
asgerf Mar 12, 2024
478dd25
JS: Rename Sets2 -> Sets
asgerf Mar 12, 2024
2c1aa08
JS: Rename Strings2 -> Strings
asgerf Mar 12, 2024
13a8e0f
JS: Add failing test for Promise.all()
asgerf Mar 13, 2024
858c79e
JS: Add plain taint step through Promise.all()
asgerf Mar 13, 2024
4043bc1
JS: Explicit mark comment as a TODO
asgerf Mar 13, 2024
e66f27c
JS: Move hasWildcardReplaceRegExp to a shared place
asgerf Mar 13, 2024
14e75be
JS: Expand comments and synthetic node name in ForOfLoops
asgerf Mar 13, 2024
e640154
JS: Be backwards compatible with AdditionalBarrierGuardNode
asgerf Mar 13, 2024
fce2be0
JS: Use BarrierGuardLegacy in TaintedPath
asgerf Mar 13, 2024
e0aae53
JS: Remove unnecessary BarrierGuardLegacy class
asgerf Mar 13, 2024
b31f20a
JS: Explain why ObjetWrapperFlowLabel is deprecated
asgerf Mar 13, 2024
11983fa
JS: Remove out-commented code
asgerf Mar 13, 2024
0a2050b
JS: Deduplicate predicate in HostHeaderPoisoningQuery
asgerf Mar 13, 2024
406b080
JS: Add comment about allowImplicitRead in PostMessageStar
asgerf Mar 13, 2024
ea4bc9c
JS: Comment about manually applying taint steps
asgerf Mar 13, 2024
fa8933e
JS: Reduce duplication in UnsafeDynamicMethodAccessQuery
asgerf Mar 13, 2024
5e7d1d5
Merge branch 'main' into js/shared-dataflow-merged
asgerf Mar 13, 2024
97567f4
JS: Update VariableCapture.qll after changes to API
asgerf Mar 13, 2024
bb1f729
Update VariableCapture.qll
asgerf Mar 13, 2024
e5bc8db
JS: Fix conflicting default for visbleImplInCallContext
asgerf Mar 13, 2024
82abd86
JS: Update uses of AccessPathSyntax
asgerf Mar 13, 2024
8ecdb5c
Update VariableCapture.qll
asgerf Mar 13, 2024
ddf6eb3
JS: Quick fix to make DeduplicatePathGraph compile
asgerf Mar 13, 2024
eff5f3b
JS: Remove duplicate dependency from qlpack.yml
asgerf Mar 13, 2024
711a08b
JS: Add TODO about switching to the shared library
asgerf Mar 15, 2024
c408ab9
Merge branch 'main' into js/shared-dataflow
asgerf May 2, 2024
2de9af2
JS: Update to getLocation() in DeduplicatePathGraph
asgerf May 6, 2024
19f1462
JS: Update use of Locations
asgerf May 6, 2024
5a2260b
JS: Update to match changes to API
asgerf May 6, 2024
23d28fc
Shared: add location for 'this' nodes
asgerf May 6, 2024
536c115
JS: Fix location override in CaptureNode
asgerf May 6, 2024
f43a189
JS: Make CaptureNode.toString() more explicit
asgerf May 6, 2024
20df5ad
JS: Bugfix in DeduplicatePathGraph
asgerf Jun 25, 2024
bd3fccd
JS: Update test output with provenance column
asgerf Jun 25, 2024
ecf418b
Merge branch 'main' into js/shared-dataflow
asgerf Jun 25, 2024
102ca77
Switch to getLocation() in DataFlowCall
asgerf Jun 25, 2024
505c532
JS: Implement totalorder()
asgerf Jun 25, 2024
64a9598
JS: Update interface for isUnreachableInCall
asgerf Jun 25, 2024
6c8fb61
Js: Update FlowSummaryImpl.qll to make things compile
asgerf Jun 25, 2024
6e32f27
Rename predicates to be consistent with qlpack
asgerf Jun 25, 2024
f0d7c3a
Remove bindingsets
asgerf Jun 25, 2024
dd7aff5
Instantiate shared FlowSummary library
asgerf Jun 25, 2024
6b35a76
Migrate to shared FlowSummary library
asgerf Jun 25, 2024
8c4e5e8
Boilerplate implementation of default predicates from FlowSummaryImpl…
asgerf Jun 26, 2024
5811a3c
Port getMadStringFromContentSet -> encodeContent
asgerf Jun 26, 2024
b0ea812
Implement encodeReturn
asgerf Jun 26, 2024
6c0c67d
Implement encodeWith/WithoutContent
asgerf Jun 26, 2024
3bebd70
Handle AnyMemberDeep and ArrayElementDeep in encodeContent
asgerf Jun 26, 2024
e67e89d
Implement decodeUnknownArgument/ParameterPosition
asgerf Jun 26, 2024
fc7c2c5
Remove unused code
asgerf Jun 26, 2024
88edc06
Avoid bad join in compatibleTypesCached
asgerf Jun 25, 2024
53efb58
JS: Update some tests with provenance columns
asgerf Jun 26, 2024
af7b4e3
Accept flow difference due to added test cases
asgerf Jun 26, 2024
2473274
JS: Benign test output changes
asgerf Jun 27, 2024
e53c0cd
Fix unknown Parameter/Argument decoding
asgerf Jun 27, 2024
c52a4b0
JS: Provide RenderSummarizedCallable
asgerf Jun 27, 2024
df0488a
Ensure Member tokens from flow summaries are seen in PropertyName
asgerf Jun 27, 2024
ee10702
JS: Another provanance test output update
asgerf Jun 27, 2024
90f0e07
JS: Benign update after fixing PropertyName charpred
asgerf Jun 27, 2024
c3806a2
JS: Messy test output updates
asgerf Jun 27, 2024
1c730bc
JS: Fix compilation error in DataFlowImplConsistency.qll
asgerf Jun 27, 2024
14fc790
Update DataFlowConsistency.expected
asgerf Jun 28, 2024
e5924c1
JS: Another messy test update
asgerf Jun 28, 2024
1d267ef
JS: Fix missing qldoc
asgerf Jun 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion javascript/ql/test/library-tests/Arrays/DataFlow.expected
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
legacyDataFlowDifference
| arrays.js:2:16:2:23 | "source" | arrays.js:39:8:39:24 | arr4_spread.pop() | only flow with OLD data flow library |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you planning to add this step to the new library?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm planning to fix this missing flow by adding general handling of the spread operator, so individual models don't have to specify how to handle spread operators. For example if a model specifies Argument[1] somewhere, and it applies to call that has a spread argument at position 0 or 1, then it should Just Work. The model shouldn't have to specify something like Argument[spread] which is what the legacy model currently does.

flow
| arrays.js:2:16:2:23 | "source" | arrays.js:5:8:5:14 | obj.foo |
| arrays.js:2:16:2:23 | "source" | arrays.js:11:10:11:15 | arr[i] |
| arrays.js:2:16:2:23 | "source" | arrays.js:15:27:15:27 | e |
| arrays.js:2:16:2:23 | "source" | arrays.js:16:23:16:23 | e |
| arrays.js:2:16:2:23 | "source" | arrays.js:20:8:20:16 | arr.pop() |
| arrays.js:2:16:2:23 | "source" | arrays.js:39:8:39:24 | arr4_spread.pop() |
| arrays.js:2:16:2:23 | "source" | arrays.js:61:10:61:10 | x |
| arrays.js:2:16:2:23 | "source" | arrays.js:65:10:65:10 | x |
| arrays.js:2:16:2:23 | "source" | arrays.js:69:10:69:10 | x |
Expand Down
2 changes: 1 addition & 1 deletion javascript/ql/test/library-tests/Arrays/TaintFlow.expected
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
legacyDataFlowDifference
| arrays.js:2:16:2:23 | "source" | arrays.js:39:8:39:24 | arr4_spread.pop() | only flow with OLD data flow library |
flow
| arrays.js:2:16:2:23 | "source" | arrays.js:5:8:5:14 | obj.foo |
| arrays.js:2:16:2:23 | "source" | arrays.js:11:10:11:15 | arr[i] |
| arrays.js:2:16:2:23 | "source" | arrays.js:15:27:15:27 | e |
| arrays.js:2:16:2:23 | "source" | arrays.js:16:23:16:23 | e |
| arrays.js:2:16:2:23 | "source" | arrays.js:20:8:20:16 | arr.pop() |
| arrays.js:2:16:2:23 | "source" | arrays.js:39:8:39:24 | arr4_spread.pop() |
| arrays.js:2:16:2:23 | "source" | arrays.js:58:8:58:13 | arr[0] |
| arrays.js:2:16:2:23 | "source" | arrays.js:61:10:61:10 | x |
| arrays.js:2:16:2:23 | "source" | arrays.js:65:10:65:10 | x |
Expand Down
Loading