Skip to content

Commit b4e4a74

Browse files
committed
make the alert messages of taint-tracking queries more consistent
1 parent 2e1c5bf commit b4e4a74

File tree

10 files changed

+19
-20
lines changed

10 files changed

+19
-20
lines changed

go/ql/src/Security/CWE-078/CommandInjection.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ from
1919
CommandInjection::Configuration cfg, CommandInjection::DoubleDashSanitizingConfiguration cfg2,
2020
DataFlow::PathNode source, DataFlow::PathNode sink
2121
where cfg.hasFlowPath(source, sink) or cfg2.hasFlowPath(source, sink)
22-
select sink.getNode(), source, sink, "This command depends on $@.", source.getNode(),
23-
"a user-provided value"
22+
select sink.getNode(), source, sink, "This command depends on a $@.", source.getNode(),
23+
"user-provided value"

go/ql/src/Security/CWE-078/StoredCommand.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ import DataFlow::PathGraph
1717

1818
from StoredCommand::Configuration cfg, DataFlow::PathNode source, DataFlow::PathNode sink
1919
where cfg.hasFlowPath(source, sink)
20-
select sink.getNode(), source, sink, "This command depends on $@.", source.getNode(),
21-
"a stored value"
20+
select sink.getNode(), source, sink, "This command depends on a $@.", source.getNode(),
21+
"stored value"

go/ql/src/Security/CWE-079/ReflectedXss.ql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ where
2424
(
2525
exists(string kind | kind = sink.getNode().(SharedXss::Sink).getSinkKind() |
2626
kind = "rawtemplate" and
27-
msg =
28-
"Cross-site scripting vulnerability due to $@. This template argument is instantiated raw $@." and
29-
part = "here"
27+
msg = "Cross-site scripting vulnerability due to $@. The value is $@." and
28+
part = "instantiated as a raw template"
3029
)
3130
or
3231
not exists(sink.getNode().(SharedXss::Sink).getSinkKind()) and

go/ql/src/Security/CWE-089/SqlInjection.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ import DataFlow::PathGraph
1717

1818
from SqlInjection::Configuration cfg, DataFlow::PathNode source, DataFlow::PathNode sink
1919
where cfg.hasFlowPath(source, sink)
20-
select sink.getNode(), source, sink, "This query depends on $@.", source.getNode(),
21-
"a user-provided value"
20+
select sink.getNode(), source, sink, "This query depends on a $@.", source.getNode(),
21+
"user-provided value"

go/ql/src/Security/CWE-117/LogInjection.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ import DataFlow::PathGraph
1717

1818
from LogInjection::Configuration c, DataFlow::PathNode source, DataFlow::PathNode sink
1919
where c.hasFlowPath(source, sink)
20-
select sink.getNode(), source, sink, "Log entry depends on $@.", source.getNode(),
21-
"a user-provided value"
20+
select sink.getNode(), source, sink, "Log entry depends on a $@.", source.getNode(),
21+
"user-provided value"

go/ql/src/Security/CWE-190/AllocationSizeOverflow.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ where
2222
cfg.hasFlowPath(source, sink) and
2323
cfg.isSink(sink.getNode(), allocsz)
2424
select sink, source, sink,
25-
"This operation, which is used in an $@, involves a potentially large $@ and might overflow.",
26-
allocsz, "allocation", source, "value"
25+
"This operation, which is used in an $@, involves a $@ and might overflow.", allocsz,
26+
"allocation", source, "potentially large value"

go/ql/src/Security/CWE-601/OpenUrlRedirect.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ where
2424
// this excludes flow from safe parts of request URLs, for example the full URL when the
2525
// doing a redirect from `http://<path>` to `https://<path>`
2626
not scfg.hasFlow(_, sink.getNode())
27-
select sink.getNode(), source, sink, "Untrusted URL redirection due to $@.", source.getNode(),
27+
select sink.getNode(), source, sink, "Untrusted URL redirection depends on a $@.", source.getNode(),
2828
"user-provided value"

go/ql/src/Security/CWE-643/XPathInjection.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ predicate isStringOrByte(DataFlow::PathNode node) {
2424

2525
from Configuration config, DataFlow::PathNode source, DataFlow::PathNode sink
2626
where config.hasFlowPath(source, sink) and isStringOrByte(sink)
27-
select sink.getNode(), source, sink, "XPath expression depends on $@.", source.getNode(),
28-
"a user-provided value"
27+
select sink.getNode(), source, sink, "XPath expression depends on a $@.", source.getNode(),
28+
"user-provided value"

go/ql/src/Security/CWE-918/RequestForgery.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ where
2323
request = sink.getNode().(Sink).getARequest() and
2424
// this excludes flow from safe parts of request URLs, for example the full URL
2525
not scfg.hasFlow(_, sink.getNode())
26-
select request, source, sink, "The $@ of this request depends on $@.", sink.getNode(),
27-
sink.getNode().(Sink).getKind(), source, "a user-provided value"
26+
select request, source, sink, "The $@ of this request depends on a $@.", sink.getNode(),
27+
sink.getNode().(Sink).getKind(), source, "user-provided value"

go/ql/src/experimental/CWE-090/LDAPInjection.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ import DataFlow::PathGraph
1515

1616
from LdapInjectionConfiguration config, DataFlow::PathNode source, DataFlow::PathNode sink
1717
where config.hasFlowPath(source, sink)
18-
select sink.getNode(), source, sink, "LDAP query parameter is derived from $@.", source.getNode(),
19-
"a user-provided value"
18+
select sink.getNode(), source, sink, "LDAP query parameter depends on a $@.", source.getNode(),
19+
"user-provided value"

0 commit comments

Comments
 (0)