Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
15 changes: 15 additions & 0 deletions javascript/ql/src/Summary/TaintSinks.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* @name Taint sinks
* @description Expressions that are vulnerable if containing untrusted data.
* @kind problem
* @problem.severity info
* @id js/summary/taint-sinks
* @tags summary
* @precision medium
*/

import javascript
import meta.internal.TaintMetrics

from string kind
select relevantTaintSink(kind), kind + " sink"
16 changes: 16 additions & 0 deletions javascript/ql/src/Summary/TaintSources.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* @name Taint sources
* @description Sources of untrusted input.
* @kind problem
* @problem.severity info
* @id js/summary/taint-sources
* @tags summary
* @precision medium
*/

import javascript
import meta.internal.TaintMetrics

from RemoteFlowSource node
where node = relevantTaintSource()
Comment on lines +14 to +15
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

relevantTaintSource has return-type DataFlow::Node, so I think the node here should have that type.

Suggested change
from RemoteFlowSource node
where node = relevantTaintSource()
from DataFlow::Node node
where node = relevantTaintSource()

Or relevantTaintSource could be changed to have the return-type RemoteFlowSource.
DOM::locationSource() is a RemoteFlowSource anyway, so relevantTaintSource could be simplified in the same go.

select node, node.getSourceType()