Chris Smowton
779901cdbd
Reference Mozilla's TLS advice in qhelp
2020-07-28 11:55:58 +01:00
Chris Smowton
718c4e8531
Add change note for insecure-TLS query
2020-07-28 11:55:58 +01:00
Chris Smowton
db27f8477a
Update CWE-327 test
...
This now checks various carve-outs for probable feature / compatibility flags
2020-07-28 11:55:58 +01:00
Chris Smowton
21d107e0e9
Check for suspected feature-flags more uniformly
...
These are now checked of all source *and* sink nodes, and the checks are factored with similar paths for is-insecure and is-old flags.
2020-07-28 11:55:58 +01:00
Chris Smowton
7d294c5d81
Factor and generalise InsecureFeatureFlag
...
The same path is now used to classify flags relating to old/legacy versions.
2020-07-28 11:21:51 +01:00
Chris Smowton
34c8cc5019
Improve documentation and function naming
2020-07-28 11:21:51 +01:00
Chris Smowton
17200a8569
Use SsaWithFields to find similar good-tls-version flows
...
Note: if accepted, merge this into a previous commit before submitting the PR
2020-07-28 10:31:45 +01:00
Chris Smowton
a7e549e771
Exclude TLS version sources accompanied by a non-nil error
...
It is common to return 0 has a dummy value with an error; these are very likely not going to be used as a real TLS version.
2020-07-28 10:31:44 +01:00
Chris Smowton
af960ed2cd
Exclude more hits whose context suggests an intentionally old TLS configuration
2020-07-28 10:31:44 +01:00
Chris Smowton
8afa0c51d9
Filter out bad TLS versions where there is a converging flow supplying a good version
...
I'm supposing these usually indicate something configurable, rather than a hard-coded insecure choice. The *default* being insecure is still a problem, but probably not amenable to automated analyses.
2020-07-28 10:31:44 +01:00
Chris Smowton
b66a91bd5f
Exclude InsecureTLS problems guarded by feature flags
2020-07-28 10:31:44 +01:00
Chris Smowton
6058c90485
Factor predicates for identifying security-related feature flags from DisabledCertificateCheck
2020-07-28 10:31:44 +01:00
Chris Smowton
a6ab92bbca
Supress paths that extend beyond the first sink
...
For this particular query it's hardly ever interesting to complain about a bad cipher suite being configured, then read from the list and re-added elsewhere. In such a case the longer path will be detected when the shorter one is fixed in any case.
2020-07-28 10:31:44 +01:00
Chris Smowton
08ec017e4c
Cleanup: disjunction -> set literal
2020-07-28 10:31:44 +01:00
Chris Smowton
75d69efb15
Merge pull request #267 from smowton/smowton/feature/print-ast-label-package-node
...
PrintAst: Label File nodes' package-name children, and ensure that child comes before all declarations
2020-07-24 13:30:12 +01:00
Chris Smowton
b4e15fb17a
Merge pull request #268 from smowton/smowton/admin/downgrade-checkout-action
...
Downgrade to checkout@v1 to work around https://github.com/actions/checkout/issues/237
2020-07-24 13:28:06 +01:00
Chris Smowton
8aaa7c8925
Downgrade to checkout@v1 to work around https://github.com/actions/checkout/issues/237
2020-07-24 11:24:51 +01:00
Chris Smowton
454993fe64
PrintAst: Label File nodes' package-name children, and ensure that child comes before all declarations
2020-07-24 11:08:57 +01:00
Chris Smowton
b9e61115f3
Merge pull request #266 from sauyon/query-tags
...
Add correctness tag to MistypedExponentiation
2020-07-22 15:27:46 +01:00
Chris Smowton
6c4a1d0a34
Merge pull request #264 from smowton/smowton/feature/printast-restrict-files
...
PrintAst: improve support for restricting subsets of the AST to print
2020-07-22 15:20:14 +01:00
Chris Smowton
f8d141f7ff
PrintAst: Sort root File nodes by relative path.
...
This should make graphtext output deterministic, rather than depending on the order the results interpretation step happens to see the nodes.
2020-07-22 13:43:34 +01:00
Sauyon Lee
c9df4d81b4
Add correctness tag to MistypedExponentiation
2020-07-22 04:26:56 -07:00
Chris Smowton
c30d198f3d
Switch to using top-level function declarations to filter PrintAst
...
This means it's no longer possible to ask for the AST of a function literal, but this is hopefully a niche use-case that we can add if and when there is demand.
2020-07-22 10:40:41 +01:00
Owen Mansel-Chan
3018874f69
Merge pull request #259 from gagliardetto/oauth2-fixed-state
...
CWE-352: Use of constant `state` in Oauth2 flow
2020-07-21 17:11:46 +01:00
Chris Smowton
09990f9764
Configure plugin AST printer to ignore comments and only print one file
2020-07-21 17:01:07 +01:00
Chris Smowton
b8c4004c59
PrintAst: support excluding comments
2020-07-21 17:01:07 +01:00
Chris Smowton
e0aa59ced1
PrintAst: improve support for restricting subsets of the AST to print
...
* Exclude function definitions, not just their children, when excluded by configuration
* Allow excluding files
* Test both features
2020-07-21 17:00:28 +01:00
Chris Smowton
a625a4c7d5
Merge pull request #263 from smowton/smowton/feature/order-functypeexpr-children
...
PrintAst: order parameter and result declarations
2020-07-21 15:47:26 +01:00
Andrew Eisenberg
f35343e618
Merge pull request #262 from aeisenberg/aeisenberg/print-ast
...
Add the printAst contextual query
2020-07-20 11:11:42 -07:00
Slavomir
02b5fce67e
Add go.mod to CWE-352 test folder
2020-07-20 17:46:12 +03:00
Chris Smowton
ce0cc31b03
PrintAst: order parameter and result declarations
...
This adds support for generally overriding the default AstNode child ordering, and uses it to sort parameter and result declarations in the context of a FuncTypeExpr in left-to-right textual order.
2020-07-20 14:32:42 +01:00
Andrew Eisenberg
0ae1330c02
Add the printAst contextual query
...
This is similar to the cpp query for printing the AST in the
context of VS Code.
This PR also includes a small refactoring to extract the
`getEncodedFile` predicate to a new `qll` file.
2020-07-17 10:12:48 -07:00
Slavomir
27f62b0b3a
Fix examples
2020-07-17 13:12:18 +03:00
Slavomir
ee2804dfb1
Improve comments
2020-07-17 11:01:25 +03:00
Slavomir
ee4356501a
Apply suggestions from code review
...
Co-authored-by: intrigus-lgtm <60750685+intrigus-lgtm@users.noreply.github.com >
2020-07-16 18:36:40 +03:00
Slavomir
fb78818db7
Fix .expected
2020-07-16 18:33:35 +03:00
Slavomir
ef7198c0cb
Improve query scenarios
2020-07-16 18:29:15 +03:00
Slavomir
282f7af6d9
Improve comments, naming, docs
2020-07-16 12:52:41 +03:00
Slavomir
8cc8b8ef47
Add CWE-352: CSRF because of constant oauth2 state value
2020-07-16 12:38:08 +03:00
Chris Smowton
830f83f21a
Merge pull request #257 from smowton/smowton/fix/go-mod-comment-group-indices
...
Extractor: assign unique indices to comment-groups in go.mod files
2020-07-13 15:40:14 +01:00
Chris Smowton
3ab948f81c
Extractor: assign unique indices to comment-groups in go.mod files
...
The schema requires that (parent, index) is a key.
2020-07-13 11:28:28 +01:00
Sauyon Lee
32510eb2d0
Merge pull request #255 from max-schaefer/alias-types
...
Improve modelling of alias declarations
2020-07-10 21:07:48 -07:00
Max Schaefer
4eac5a1d4e
Add test to demonstrate that aliases have entities.
...
There are, however, no corresponding types.
2020-07-10 14:41:15 +01:00
Max Schaefer
1a8688a8f4
Extract enough information to distinguish type definitions from alias declarations.
2020-07-10 14:12:51 +01:00
Max Schaefer
4257a68c27
Include newlines in messages printed by go-gen-dbscheme.
2020-07-10 14:08:37 +01:00
Max Schaefer
9347413e77
Merge pull request #254 from smowton/smowton/admin/fix-go-autoformat
...
Make the gofmt CI test actually fatal
2020-07-10 14:01:44 +01:00
Chris Smowton
d05657ddff
Make the gofmt CI test actaully fatal
...
Turns out gofmt doesn't actually return 1 when it finds problems, only when it finds source files which don't compile (all of which are now excluded).
This also fixes existing overlooked inconsistencies as a result of this mistake.
2020-07-10 11:02:50 +01:00
Max Schaefer
302eb55d23
Merge pull request #245 from smowton/smowton/feature/missing-error-check-query-conservative
...
Add query searching for missing error checks on functions that return a (pointer, error) pair
2020-07-09 15:37:32 +01:00
Chris Smowton
429a385a20
Add query searching for missing error checks on functions that return a (pointer, error) pair
2020-07-09 13:06:31 +01:00
Max Schaefer
02920abc62
Merge pull request #249 from smowton/smowton/feature/comment-group-ast-node-parents
...
Make CommentGroups AST-children of Files
2020-07-08 19:58:13 +01:00