Skip to content

Commit 74cd240

Browse files
Jami CogswellJami Cogswell
authored andcommitted
C#: update 'xss' sink kind to 'js-injection'
1 parent a0b502f commit 74cd240

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

csharp/ql/lib/ext/System.Net.Http.model.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ extensions:
33
pack: codeql/csharp-all
44
extensible: sinkModel
55
data:
6-
- ["System.Net.Http", "StringContent", False, "StringContent", "", "", "Argument[0]", "xss", "manual"]
6+
- ["System.Net.Http", "StringContent", False, "StringContent", "", "", "Argument[0]", "js-injection", "manual"]
77
- addsTo:
88
pack: codeql/csharp-all
99
extensible: summaryModel

csharp/ql/lib/ext/generated/dotnet_runtime.model.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ extensions:
99
data:
1010
- ["System.Data.Odbc", "OdbcDataAdapter", false, "OdbcDataAdapter", "(System.String,System.Data.Odbc.OdbcConnection)", "", "Argument[0]", "sql-injection", "df-generated"]
1111
- ["System.Data.Odbc", "OdbcDataAdapter", false, "OdbcDataAdapter", "(System.String,System.String)", "", "Argument[0]", "sql-injection", "df-generated"]
12-
- ["System.Net.Http", "StringContent", false, "StringContent", "(System.String)", "", "Argument[0]", "xss", "df-generated"]
13-
- ["System.Net.Http", "StringContent", false, "StringContent", "(System.String,System.Text.Encoding)", "", "Argument[0]", "xss", "df-generated"]
12+
- ["System.Net.Http", "StringContent", false, "StringContent", "(System.String)", "", "Argument[0]", "js-injection", "df-generated"]
13+
- ["System.Net.Http", "StringContent", false, "StringContent", "(System.String,System.Text.Encoding)", "", "Argument[0]", "js-injection", "df-generated"]
1414
- ["System.Security.Cryptography", "AesCryptoServiceProvider", false, "CreateDecryptor", "(System.Byte[],System.Byte[])", "", "Argument[0]", "encryption-decryptor", "df-generated"]
1515
- ["System.Security.Cryptography", "AesCryptoServiceProvider", false, "CreateEncryptor", "(System.Byte[],System.Byte[])", "", "Argument[0]", "encryption-encryptor", "df-generated"]
1616
- ["System.Security.Cryptography", "AesCryptoServiceProvider", false, "set_Key", "(System.Byte[])", "", "Argument[0]", "encryption-keyprop", "df-generated"]

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-injection"] and
214+
not kind = ["code-injection", "sql-injection", "js-injection", "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/XSSSinks.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ abstract class Sink extends DataFlow::ExprNode, RemoteFlowSink {
2424
}
2525

2626
private class ExternalXssSink extends Sink {
27-
ExternalXssSink() { sinkNode(this, "xss") }
27+
ExternalXssSink() { sinkNode(this, "js-injection") }
2828
}
2929

3030
private class HtmlSinkSink extends Sink instanceof HtmlSink {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ invalidModelRow
44
| Sinks.cs:11:13:11:41 | this access | remote |
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 |
7-
| Sinks.cs:20:20:20:22 | access to local variable res | xss |
7+
| Sinks.cs:20:20:20:22 | access to local variable res | js-injection |
88
| 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
@@ -5,7 +5,7 @@ extensions:
55
data:
66
# "namespace", "type", "overrides", "name", "signature", "ext", "spec", "kind", "provenance"
77
- ["My.Qltest", "B", false, "Sink1", "(System.Object)", "", "Argument[0]", "code-injection", "manual"]
8-
- ["My.Qltest", "B", false, "SinkMethod", "()", "", "ReturnValue", "xss", "manual"]
8+
- ["My.Qltest", "B", false, "SinkMethod", "()", "", "ReturnValue", "js-injection", "manual"]
99
- ["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)