Commit Graph

259 Commits

Author SHA1 Message Date
Owen Mansel-Chan
3cbce80d0b Add SimpleTypeSanitizer to go/request-forgery 2025-10-09 12:17:21 +01:00
Owen Mansel-Chan
7599fdd8fa Add request forgery test for numeric type 2025-10-09 12:17:19 +01:00
Owen Mansel-Chan
2629369c93 Improve additional flow step for Host field 2025-10-01 16:18:05 +01:00
Owen Mansel-Chan
6d6852fb8d Test PathAssignmentBarrier for OpenUrlRedirect 2025-10-01 16:18:02 +01:00
Owen Mansel-Chan
c9a2816bfe Fix OpenUrlRedirect barrier for write to Url.Host 2025-10-01 16:13:24 +01:00
Owen Mansel-Chan
414bab1f30 Add OpenUrlRedirect tests for Url.Host field 2025-10-01 16:13:22 +01:00
Owen Mansel-Chan
1144bb99b4 Convert OpenUrlRedirect tests to InlineExpectations 2025-10-01 16:13:21 +01:00
Owen Mansel-Chan
25f182302d Fix email injection sink that needs local flow 2025-10-01 16:13:10 +01:00
Owen Mansel-Chan
5efc8ac1a4 Fix backwards flow through TaintTracking::FunctionModel
We only do this for taint models as there isn't any backwards flow
through data flow function models.
2025-10-01 16:13:01 +01:00
Owen Mansel-Chan
3906f2560d Adjust Stack Exposure test so it passes
A minor bug in our CFG means that we evaluate the base of a
SliceExpr before the bounds. Since the bounds may have side
effects, as in this case, it would be better to evaluate them first.
But in the short term I am just adjusting the test to make it work.
2025-10-01 16:12:59 +01:00
Owen Mansel-Chan
cf6cfe2a1e Non-initializing writes should target post-update nodes 2025-10-01 16:12:54 +01:00
Owen Mansel-Chan
8a3bd8408b Fix test expectations for Cleartext Logging
One spurious alert was removed, one missing alert was added, and some
source locations changed.
2025-10-01 16:12:52 +01:00
Owen Mansel-Chan
d2230c531d Expected changes in test output 2025-10-01 16:12:47 +01:00
Owen Mansel-Chan
a0c647ce83 Add Email Injection tests for reverse flow models 2025-10-01 16:12:43 +01:00
Owen Mansel-Chan
14301e0af4 Expected changes in dataflow edges 2025-10-01 16:12:28 +01:00
Owen Mansel-Chan
3594dba83c Make insecure randomness test more realistic 2025-10-01 16:12:24 +01:00
Owen Mansel-Chan
b2a9cecd69 Fix Allocation Size Overflow for use-use flow
We have an operator expression like `x * 5`. We want to follow where the
value of the operator expression goes. We used to follow local flow from
an operand, but now there is flow from that operand to the next use of
the variable. The fix is to explicitly start local flow from the
operator expression.

There are also some expected edge changes due to use-use flow.
2025-10-01 16:12:18 +01:00
Owen Mansel-Chan
16a11b48ad Switch to use-use dataflow. This will make post-update nodes easy to implement.
Queries / tests that required changes:
* The CleartextLogging and MissingErrorCheck queries are updated because they assumed def-use flow
* The CommandInjection query works around the shortcomings of use-use flow by essentially reintroducing def-use flow when it applies a sanitizer
* The OpenUrlRedirect query currently just accepts its fate; the tests are updated to avoid excess sanitization while the query comments on the problem. We should choose this approach or the CommandInjection one.
2025-10-01 16:12:07 +01:00
Chris Smowton
e9cccb46c0 Go: mistyped-exponentiation: notice constants with likely-bitmask values 2025-09-25 15:19:40 +01:00
Owen Mansel-Chan
2a45b28e5f Merge pull request #20064 from Kwstubbs/go-path-separator
Update Go Path Injection Sanitizer and Sink
2025-09-03 16:45:15 +01:00
Kevin Stubbings
b4b848a25c Fix tests and simplify sanitizer 2025-07-21 21:53:35 +00:00
Kevin Stubbings
f86152d3bd Add sanitizer changes and fix test 2025-07-16 21:27:33 +00:00
Kevin Stubbings
504ae0f35a Update go path sanitizers and sinks 2025-07-16 06:12:45 +00:00
Chris Smowton
c8eefb7c5c Golang: Mark filepath.IsLocal as a tainted-path sanitizer guard 2025-07-15 14:47:17 +01:00
Owen Mansel-Chan
990043ce86 Add net/http.Head and net/http.Client.Head as client requests
They were previously deliberately excluded.
2025-07-08 14:31:48 +01:00
Owen Mansel-Chan
d437a096f1 Test more client request URL sinks 2025-07-08 13:20:04 +01:00
Owen Mansel-Chan
0788a90d88 Convert RequestForgery test to inline expectations 2025-07-04 16:56:05 +01:00
Owen Mansel-Chan
d10b9e665c Fix linter warnings in Request Forgery tests 2025-07-04 16:55:09 +01:00
Nora Dimitrijević
cf92b0e91b Go: convert IncorrectIntegerConversion test to .qlref 2025-06-24 14:57:48 +02:00
Nora Dimitrijević
76a3306c63 Go: convert UncontrolledAllocationSize test to .qlref 2025-06-24 14:57:44 +02:00
Owen Mansel-Chan
ef5e605cc4 Merge pull request #19386 from owen-mc/go/promote/html-template-escaping-bypass-xss
Go: promote `html-template-escaping-bypass-xss`
2025-06-06 12:36:27 +01:00
Owen Mansel-Chan
d39e7c2066 Added named import to definitions test
This makes the test slightly more thorough.
2025-05-20 13:13:21 +01:00
Owen Mansel-Chan
e6c19b0cbd Modernize tests 2025-05-01 15:40:14 +01:00
Owen Mansel-Chan
cba0bec3c6 Rename files 2025-05-01 15:40:12 +01:00
Owen Mansel-Chan
cbdbb0310b Tidy up test (remove duplicated main) 2025-05-01 15:40:06 +01:00
Owen Mansel-Chan
4e5a865337 Manually fix copilot's mistakes and get query working 2025-05-01 15:40:04 +01:00
Owen Mansel-Chan
c2ebdf5266 Change query id to go/html-template-escaping-bypass-xss 2025-05-01 15:39:20 +01:00
Owen Mansel-Chan
1926ffd450 Convert XSS tests to use inline expectations 2025-05-01 15:39:19 +01:00
Owen Mansel-Chan
1530ac123c Update path in qlref and update test results 2025-05-01 15:39:17 +01:00
Owen Mansel-Chan
5bce70f78c Move files out of experimental (no changes) 2025-05-01 15:39:15 +01:00
Owen Mansel-Chan
b6053e3f91 Merge pull request #19076 from owen-mc/go/update-depstubber-files
Go: update files generated by depstubber
2025-04-09 11:44:20 +01:00
Owen Mansel-Chan
e44f7f946f Sort package paths in vendor/modules.txt 2025-03-21 09:45:50 +00:00
Owen Mansel-Chan
11ff0a08f3 Add log injection and cleartext logging tests for %T 2025-03-20 15:08:02 +00:00
Owen Mansel-Chan
646d28feeb Make cleartext logging tests more realistic 2025-03-20 15:08:00 +00:00
Owen Mansel-Chan
94c812cbe6 Convert cleartext logging tests to inline expectations 2025-03-20 15:07:59 +00:00
Owen Mansel-Chan
59d82b3b62 Make log injection tests more realistic 2025-03-20 15:07:57 +00:00
Owen Mansel-Chan
40768332d8 Remove empty imports from stubs 2025-03-20 12:32:12 +00:00
Owen Mansel-Chan
81e85010f9 List subpackages in vendor/modules.txt
These were all generated by running depstubber.
2025-03-20 12:30:57 +00:00
Owen Mansel-Chan
7b2912376b Add failing test for os.File.Sync with defered Close calls 2025-03-06 10:14:28 +00:00
Owen Mansel-Chan
63bfa36be8 Convert to inline expectations test 2025-03-05 21:39:04 +00:00