JS: Move getName() to a shared location

This commit is contained in:
Asger F
2025-01-09 11:19:16 +01:00
parent f845ac1dd8
commit 30d192a1db
2 changed files with 8 additions and 8 deletions

View File

@@ -11,13 +11,6 @@
import javascript
import meta.internal.TaintMetrics
string getName(DataFlow::Node node) {
result = node.(RemoteFlowSource).getSourceType()
or
not node instanceof RemoteFlowSource and
result = "Taint source"
}
from DataFlow::Node node
where node = relevantTaintSource()
select node, getName(node)
select node, getTaintSourceName(node)

View File

@@ -100,3 +100,10 @@ DataFlow::Node relevantSanitizerInput() {
result = any(HtmlSanitizerCall call).getInput() and
not result.getFile() instanceof IgnoredFile
}
string getTaintSourceName(DataFlow::Node node) {
result = node.(RemoteFlowSource).getSourceType()
or
not node instanceof RemoteFlowSource and
result = "Taint source"
}