Commit Graph

222 Commits

Author SHA1 Message Date
Max Schaefer
6d93f48933 Merge pull request #147 from owen-mc/redundant-recover
Go: Add query for redundant calls to recover
2020-05-19 07:14:27 +01:00
Owen Mansel-Chan
23a7db5d4d Minor textual corrections 2020-05-18 17:05:49 +01:00
Owen Mansel-Chan
fbee7fe983 Add new query for redundant calls to recover 2020-05-18 16:13:46 +01:00
Max Schaefer
27cb92fb86 Use .pp() in a few tests selecting types. 2020-05-15 15:54:23 +01:00
Max Schaefer
d300ec6324 Refine Method.implements so that interface methods only implement themselves.
Without this restriction, the two `m`s in the following example are considered to implement each other, even though they aren't logically related:

```go
type I interface {
  m()
}

type J interface {
  m()
}

type K struct {
  I
  J
}
```

Previously, interface methods would sometimes implement themselves and sometimes not (see changes to test output for examples).
2020-05-15 11:09:17 +01:00
Max Schaefer
d41e41812b Merge pull request #141 from sauyon/reflectedxss-fps
ReflectedXss improvements
2020-05-15 07:23:39 +01:00
Sauyon Lee
5e2b973ac4 Update comment in ReflectedXss test
Co-authored-by: Max Schaefer <54907921+max-schaefer@users.noreply.github.com>
2020-05-14 14:35:08 -07:00
Sauyon Lee
ee0f3c9fba Address review comments 2020-05-14 02:30:14 -07:00
Sauyon Lee
97b3ec5cfc Update dependency stubs 2020-05-13 10:07:14 -07:00
Max Schaefer
ac9e39120b Fix unused variable in test. 2020-05-13 15:28:49 +01:00
Max Schaefer
e034458574 Fix MongoDB tests. 2020-05-13 15:25:54 +01:00
Sauyon Lee
2089cb4543 Merge pull request #133 from max-schaefer/cleanup-conditional-bypass
Cleanup conditional-bypass query
2020-05-13 02:31:13 -07:00
Max Schaefer
005e49fe94 Merge pull request #130 from porcupineyhairs/MongoInjection
Golang : Add MongoDB injection support
2020-05-13 09:43:49 +01:00
Sauyon Lee
24e939730a Merge pull request #134 from max-schaefer/fix-test-errors
Fix frontend errors in tests
2020-05-13 01:38:30 -07:00
Max Schaefer
89d633ac3f Merge pull request #120 from porcupineyhairs/SensitiveActionBypass
User-controlled bypass of sensitive action
2020-05-12 19:48:24 +01:00
Max Schaefer
d438b5ec03 Merge pull request #131 from porcupineyhairs/IO
Model stdlib's IO package.
2020-05-12 19:41:40 +01:00
Slavomir
84e2a5ddd2 Add experimental library: gin web framework (#117) 2020-05-12 14:27:11 +01:00
Max Schaefer
6f21b4030e Merge pull request #135 from sauyon/tempfile-test
Add support for ioutil TempFile and TempDir
2020-05-12 14:25:38 +01:00
Max Schaefer
5dac94d24c Merge pull request #116 from gagliardetto/CWE-681
CWE 681
2020-05-12 11:59:08 +01:00
Sauyon Lee
58e41e9302 ReflectedXss: More broadly exclude values with a constant prefix 2020-05-11 15:49:37 -07:00
Porcupiney Hairs
d0061bfd4b Golang : Add MongoDB injection support
This PR adds support for MongoDB injection to the existing SQL injection query.
This models the official Golang MongoDB driver.

A  brief summary of changes made in this query are :

1. A `NoSQL.qll` files has been created to model a `NoSQLQueryString`.

2. An entry is added in `go.qll` by default as I find these changes may be generally useful.

3. Library tests along with there expected outputs are added.

4. Query tests are added. However, I am unable to add the expected output as qltest
can't find depstubber. However, these can be easily added. I have created a separate
codeql-go database with the same files and ran the query against the same. I can see
there should be 14 correct results added from this PR.
2020-05-11 19:55:48 +05:30
Porcupiney Hairs
9b53ad3b3c model IO package 2020-05-11 19:39:01 +05:30
Porcupiney Hairs
c1856ba260 fix tests 2020-05-11 19:32:28 +05:30
Max Schaefer
4a7171d91e Fix frontend errors in BadRedirectCheck tests. 2020-05-11 11:45:21 +01:00
Max Schaefer
17dd99d326 Fix frontend errors in Mux tests. 2020-05-11 11:45:08 +01:00
Max Schaefer
df9902512f More cleanup in help and tests.
In particular, I have copied over the examples referenced in the qhelp into the test folder and made sure they compile.
2020-05-11 11:07:38 +01:00
Max Schaefer
287dda0ab5 Minor cleanup in query and tests. 2020-05-11 11:05:40 +01:00
Max Schaefer
78201a2c5f Rename ConditionBypass* to ConditionalBypass* for consistency with other languages. 2020-05-11 10:47:00 +01:00
Max Schaefer
3e830b69b5 Merge pull request #121 from porcupineyhairs/conditionBypass
User-controlled bypass of a comparision
2020-05-11 10:41:33 +01:00
Sauyon Lee
181c03ebf3 Add support for ioutil TempFile and TempDir 2020-05-10 18:25:55 -07:00
Porcupiney Hairs
b32ac2a47f fix tests 2020-05-11 04:51:17 +05:30
Porcupiney Hairs
3d10ec7e51 remove some obvious false positives and include changes from review 2020-05-11 03:13:01 +05:30
Max Schaefer
96120e1e35 Update expected output. 2020-05-06 19:43:27 +01:00
Sauyon Lee
164149b29a Merge pull request #129 from max-schaefer/fix-argument-post-update-nodes
Fix and improve taint-tracking through function arguments
2020-05-06 02:57:01 -07:00
Max Schaefer
2fb3d39f61 Merge pull request #128 from sauyon/mux
Add support for Mux library
2020-05-05 13:57:37 +01:00
Max Schaefer
b177d58c88 Tweak test.
The query under test isn't a `@problem` query, so we should refer to "alerts".
2020-05-05 12:05:09 +01:00
Max Schaefer
60a6c96863 Simplify modeling of NewContent. 2020-05-05 12:05:09 +01:00
Sauyon Lee
a841077cbe Add support for Mux library 2020-05-05 03:25:08 -07:00
Max Schaefer
e632c75de3 Add support for taint models involving "backwards" taint propagation from results to arguments. 2020-05-04 16:36:38 +01:00
Max Schaefer
d0e8d6efda Fix post-update nodes for function arguments. 2020-05-04 16:36:38 +01:00
Max Schaefer
04a19b7150 Clean up EmailInjection.qll and related libraries. 2020-05-04 09:13:23 +01:00
porcupineyhairs
657108d598 Add Email Content Injection Query (#108)
This adds a query for Email content injection issues.
It models the Golang's net/smtp library as well as
the Sendgrid email library (581 stars).
2020-05-04 07:54:30 +01:00
Sauyon Lee
cd1d699208 Improve BadRedirectCheck query
We now look for a path from the variable being checked to a redirect.

Additionally, several sources of false positives have been eliminated, and a model of relevant parts of the Macaron framework has been added.
2020-05-01 07:13:16 +01:00
Slavomir
127cd3d003 Refactor query 2020-04-30 16:46:19 +03:00
Slavomir
b9fae2e5d0 Add newline 2020-04-30 16:46:19 +03:00
Slavomir
c9c7e6c0a9 Add more test cases: add negative cases 2020-04-30 16:46:19 +03:00
Slavomir
f093226dab Move query to experimental 2020-04-30 16:46:19 +03:00
Slavomir
74481c4bad CWE-681: initial commit 2020-04-30 16:46:19 +03:00
Max Schaefer
dd4f1ca70b Merge pull request #125 from gagliardetto/exec-syscall
Add syscall functions to SystemCommandExecutors
2020-04-30 07:21:28 +01:00
Sauyon Lee
417102c120 Merge pull request #124 from github/rc/1.24
Merge rc/1.24 into master
2020-04-29 12:27:56 -07:00