|
4 | 4 |
|
5 | 5 | private import codeql.ruby.AST
|
6 | 6 | private import codeql.ruby.DataFlow
|
7 |
| -private import codeql.ruby.DataFlow2 |
8 | 7 | private import codeql.ruby.CFG
|
9 | 8 | private import codeql.ruby.Concepts
|
10 | 9 | private import codeql.ruby.Frameworks
|
@@ -291,20 +290,18 @@ private module OrmTracking {
|
291 | 290 | /**
|
292 | 291 | * A data flow configuration to track flow from finder calls to field accesses.
|
293 | 292 | */
|
294 |
| - class Configuration extends DataFlow2::Configuration { |
295 |
| - Configuration() { this = "OrmTracking" } |
296 |
| - |
297 |
| - override predicate isSource(DataFlow2::Node source) { source instanceof OrmInstantiation } |
| 293 | + private module Config implements DataFlow::ConfigSig { |
| 294 | + predicate isSource(DataFlow::Node source) { source instanceof OrmInstantiation } |
298 | 295 |
|
299 | 296 | // Select any call receiver and narrow down later
|
300 |
| - override predicate isSink(DataFlow2::Node sink) { |
301 |
| - sink = any(DataFlow2::CallNode c).getReceiver() |
302 |
| - } |
| 297 | + predicate isSink(DataFlow::Node sink) { sink = any(DataFlow::CallNode c).getReceiver() } |
303 | 298 |
|
304 |
| - override predicate isAdditionalFlowStep(DataFlow2::Node node1, DataFlow2::Node node2) { |
| 299 | + predicate isAdditionalFlowStep(DataFlow::Node node1, DataFlow::Node node2) { |
305 | 300 | Shared::isAdditionalXssFlowStep(node1, node2)
|
306 | 301 | }
|
307 | 302 | }
|
| 303 | + |
| 304 | + import DataFlow::Make<Config> |
308 | 305 | }
|
309 | 306 |
|
310 | 307 | /** Provides default sources, sinks and sanitizers for detecting stored cross-site scripting (XSS) vulnerabilities. */
|
@@ -333,10 +330,10 @@ module StoredXss {
|
333 | 330 | /** DEPRECATED: Alias for isAdditionalXssTaintStep */
|
334 | 331 | deprecated predicate isAdditionalXSSTaintStep = isAdditionalXssTaintStep/2;
|
335 | 332 |
|
336 |
| - private class OrmFieldAsSource extends Source instanceof DataFlow2::CallNode { |
| 333 | + private class OrmFieldAsSource extends Source instanceof DataFlow::CallNode { |
337 | 334 | OrmFieldAsSource() {
|
338 |
| - exists(OrmTracking::Configuration subConfig, DataFlow2::CallNode subSrc | |
339 |
| - subConfig.hasFlow(subSrc, this.getReceiver()) and |
| 335 | + exists(DataFlow::CallNode subSrc | |
| 336 | + OrmTracking::hasFlow(subSrc, this.getReceiver()) and |
340 | 337 | subSrc.(OrmInstantiation).methodCallMayAccessField(this.getMethodName())
|
341 | 338 | )
|
342 | 339 | }
|
|
0 commit comments