Slavomir
7b4a748793
Remove DummySource
2021-04-08 14:24:35 +01:00
Slavomir
7e9f23ab8e
Refactor flow logic to ensure untrusted flows to conversion, and conversion flows to template-exec.
2021-04-08 14:24:35 +01:00
Slavomir
963631dedf
Improve naming.
2021-04-08 14:24:35 +01:00
Slavomir
687e556df6
Fixes from code review
2021-04-08 14:24:35 +01:00
Slavomir
ad91e4abcb
Remove DummySource
2021-04-08 14:24:35 +01:00
Slavomir
63d51205c9
Apply suggestions from code review
...
Co-authored-by: Sauyon Lee <sauyon@github.com >
2021-04-08 14:24:35 +01:00
Slavomir
49894341a8
Add CWE-79: HTML template escaping passthrough
2021-04-08 14:24:35 +01:00
Sauyon Lee
cd6fb7d699
Extract files for error locations
...
Co-authored-by: Chris Smowton <smowton@github.com >
2021-03-31 03:37:55 -07:00
Owen Mansel-Chan
2fce333a0b
Fix bad join order in getBaseInstruction
...
It was joining on the index first, rather than the selector expression
2021-03-30 10:13:31 +01:00
Owen Mansel-Chan
3e57ea0e75
Fix Revel template test
...
We want the controller, which is the type which embeds *Revel.Controller.
We have to skip the implicit field reads to get to the base of the selector
expression.
2021-03-30 10:13:30 +01:00
Owen Mansel-Chan
b507c0d584
Add implicit field reads for promoted method calls
2021-03-30 10:13:30 +01:00
Owen Mansel-Chan
a89a42df6f
Expand PromotedField to PromotedValueEntity
...
This includes promoted methods as well
2021-03-30 10:13:29 +01:00
Owen Mansel-Chan
42300819a5
Remove incorrect assumption
...
Now that we have implicit field reads, it is no longer the case
that the base of a field read instruction will be an eval
instruction.
2021-03-30 10:13:28 +01:00
Owen Mansel-Chan
44b4e211c1
Make ImplicitFieldReadInstruction extend ImplicitFieldReadInstruction
...
This avoids some code duplication.
2021-03-30 10:13:28 +01:00
Owen Mansel-Chan
00aac808d2
Address review comments
2021-03-30 10:13:27 +01:00
Owen Mansel-Chan
a5293fa835
Use index to determine selector base
2021-03-30 10:13:27 +01:00
Owen Mansel-Chan
015c0537c2
Add index to FieldReadInstruction
2021-03-30 10:13:27 +01:00
Owen Mansel-Chan
0d071b2119
Use depth for implicit field selection
2021-03-30 10:13:26 +01:00
Chris Smowton
204e313c3b
Improve documentation
2021-03-30 10:13:26 +01:00
Chris Smowton
6645613eb8
Deduplicate and document helper types
2021-03-30 10:13:25 +01:00
Chris Smowton
9a427931b7
Explicitly walk pointer types
...
In a previous draft these could use getBaseType*
2021-03-30 10:13:25 +01:00
Chris Smowton
660ba4e31c
Optimise selectorBase, similar to existing work on implicitFieldRead
2021-03-30 10:13:25 +01:00
Chris Smowton
8cde56dfc2
Neaten and fix documentation of selectorBase
2021-03-30 10:13:24 +01:00
Chris Smowton
9444774895
Add further hints that the range of possible addressed fields, and therefore the interesting selector expressions, are small
2021-03-30 10:13:24 +01:00
Chris Smowton
22a3fccf79
Use type to hint that constraining to embedded fields is a good first step
...
This improves the join order for `implicitFieldSelection`
2021-03-30 10:13:23 +01:00
Sauyon Lee
e1b4867a19
Refactor embedded field calculation to expose access chain
...
This allows us to reuse the embedded field calculation in the
logic for generating implicit field selection nodes.
2021-03-30 10:13:23 +01:00
Owen Mansel-Chan
13cd19ee40
Make ImplicitFieldReadInstruction include implicit deref when needed
...
When an ImplicitFieldReadInstruction reads an embedded field which has
a pointer type, it now includes the implicit dereference.
It might be better to extend MkImplicitDeref to cover this case, so we have
an explicit instruction for this. Then it would be easier to see when
dereferences are happening, and hence when they might cause a nil pointer
dereference.
2021-03-30 10:13:22 +01:00
Owen Mansel-Chan
2d3caf48c1
Add implicit field reads for promoted fields
...
This may not work when the embedded fields are pointer types, as
we don't have anything corresponding to MkImplicitDeref
2021-03-30 10:13:21 +01:00
Owen Mansel-Chan
7ded91e81d
Make depth of promoted fields accessible
2021-03-30 10:13:21 +01:00
Owen Mansel-Chan
b6dddd36e1
Update FieldTarget.getBaseType()
...
It wasn't defined when `getBase()` was an EvalImplicitDerefInstruction.
Rewriting it like this means it should work no matter what type of
instruction `getBase()` is.
2021-03-30 10:13:20 +01:00
Owen Mansel-Chan
b32b3157d4
(Minor) Add missing this. to method call
2021-03-30 10:13:19 +01:00
Tom Hvitved
e119e15f84
Merge branch 'rc/3.1' into 'main'
2021-03-23 09:10:20 +01:00
Sauyon Lee
bcee55c402
Remove now-unnecessary bindingset annotations
2021-03-20 18:54:26 +00:00
Sauyon Lee
426a65b981
Restrict 'package' to real package paths
2021-03-20 18:54:26 +00:00
Sauyon Lee
92c5999c4d
Update stats
2021-03-19 04:34:16 -07:00
Sauyon Lee
d8885c580a
Add extractor diagnostic tables to the database
2021-03-19 04:34:13 -07:00
Sauyon Lee
c2321bd365
Add support for XSS sink kinds
2021-03-18 10:51:16 -07:00
Sauyon Lee
9f5a9cf7b8
Add HTTP template response body concept
2021-03-18 10:51:15 -07:00
Sauyon Lee
844f0e49a6
Add getEnclosingTextNode to template statements
2021-03-18 10:51:15 -07:00
Sauyon Lee
96d2777431
Add models for Revel raw templates
2021-03-18 10:51:14 -07:00
Sauyon Lee
4932574083
Add HTML template variable model
2021-03-18 10:51:14 -07:00
Sauyon Lee
e3f68771fc
Add VariableWithFields
2021-03-18 10:51:13 -07:00
Sauyon Lee
8438b893ec
Add HTML tracing capability
2021-03-18 10:51:12 -07:00
sn00py
263d813b58
Merge branch 'main' into add-transport-roundtrip
2021-03-16 23:54:53 +08:00
Owen Mansel-Chan
f9c4e12c95
Make this. explicit
2021-03-16 13:40:58 +00:00
Owen Mansel-Chan
ea7ecbaa55
Add hint so optimizer doesn't choose bad join order
2021-03-16 13:40:58 +00:00
Owen Mansel-Chan
c940eb61e7
Cache TControlFlowNode
2021-03-16 13:40:58 +00:00
snoopywu
cee30cfde4
fix: autoformat
2021-03-16 01:43:33 +08:00
sn00py
00f12f9210
Update ql/src/semmle/go/frameworks/stdlib/NetHttp.qll
...
Co-authored-by: Sauyon Lee <sauyon@github.com >
2021-03-16 00:41:52 +08:00
snoopywu
e1219480d8
Add Transport.RoundTrip()
2021-03-13 03:17:58 +08:00