Skip to content

Commit a0b502f

Browse files
Jami CogswellJami Cogswell
authored andcommitted
C#: update 'html' sink kind to 'html-injection'
1 parent f76563d commit a0b502f

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

csharp/ql/lib/ext/System.Web.model.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ extensions:
33
pack: codeql/csharp-all
44
extensible: sinkModel
55
data:
6-
- ["System.Web", "HttpResponse", False, "BinaryWrite", "", "", "Argument[0]", "html", "manual"]
7-
- ["System.Web", "HttpResponse", False, "TransmitFile", "", "", "Argument[0]", "html", "manual"]
8-
- ["System.Web", "HttpResponse", False, "Write", "", "", "Argument[0]", "html", "manual"]
9-
- ["System.Web", "HttpResponse", False, "WriteFile", "", "", "Argument[0]", "html", "manual"]
6+
- ["System.Web", "HttpResponse", False, "BinaryWrite", "", "", "Argument[0]", "html-injection", "manual"]
7+
- ["System.Web", "HttpResponse", False, "TransmitFile", "", "", "Argument[0]", "html-injection", "manual"]
8+
- ["System.Web", "HttpResponse", False, "Write", "", "", "Argument[0]", "html-injection", "manual"]
9+
- ["System.Web", "HttpResponse", False, "WriteFile", "", "", "Argument[0]", "html-injection", "manual"]
1010
- addsTo:
1111
pack: codeql/csharp-all
1212
extensible: summaryModel

csharp/ql/lib/semmle/code/csharp/dataflow/ExternalFlow.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ module ModelValidation {
211211
)
212212
or
213213
exists(string kind | sinkModel(_, _, _, _, _, _, _, kind, _) |
214-
not kind = ["code-injection", "sql-injection", "xss", "remote", "html"] and
214+
not kind = ["code-injection", "sql-injection", "xss", "remote", "html-injection"] and
215215
not kind.matches("encryption-%") and
216216
result = "Invalid kind \"" + kind + "\" in sink model."
217217
)

csharp/ql/lib/semmle/code/csharp/security/dataflow/flowsinks/Html.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ private import semmle.code.asp.AspNet
2323
abstract class HtmlSink extends DataFlow::ExprNode, RemoteFlowSink { }
2424

2525
private class ExternalHtmlSink extends HtmlSink {
26-
ExternalHtmlSink() { sinkNode(this, "html") }
26+
ExternalHtmlSink() { sinkNode(this, "html-injection") }
2727
}
2828

2929
/**

csharp/ql/test/library-tests/dataflow/external-models/sinks.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ invalidModelRow
55
| Sinks.cs:11:30:11:40 | access to local variable argToTagged | remote |
66
| Sinks.cs:14:27:14:36 | access to local variable fieldWrite | sql-injection |
77
| Sinks.cs:20:20:20:22 | access to local variable res | xss |
8-
| Sinks.cs:27:20:27:25 | access to local variable resTag | html |
8+
| Sinks.cs:27:20:27:25 | access to local variable resTag | html-injection |

csharp/ql/test/library-tests/dataflow/external-models/sinks.ext.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ extensions:
66
# "namespace", "type", "overrides", "name", "signature", "ext", "spec", "kind", "provenance"
77
- ["My.Qltest", "B", false, "Sink1", "(System.Object)", "", "Argument[0]", "code-injection", "manual"]
88
- ["My.Qltest", "B", false, "SinkMethod", "()", "", "ReturnValue", "xss", "manual"]
9-
- ["My.Qltest", "SinkAttribute", false, "", "", "Attribute", "ReturnValue", "html", "manual"]
9+
- ["My.Qltest", "SinkAttribute", false, "", "", "Attribute", "ReturnValue", "html-injection", "manual"]
1010
- ["My.Qltest", "SinkAttribute", false, "", "", "Attribute", "Argument", "remote", "manual"]
1111
- ["My.Qltest", "SinkAttribute", false, "", "", "Attribute", "", "sql-injection", "manual"]

0 commit comments

Comments
 (0)