Chris Smowton
fb85ccb2a5
Look through implicit deref operations when propagating taint down a chain of field- and element-access instructions.
...
This enables us to use PostUpdateNode properly. Also introduce a test showing a case where this doesn't work, because the underlying variable doesn't have a post-update node.
2020-09-04 17:03:52 +01:00
Chris Smowton
3635d7d007
Introduce and use writeComponent
2020-09-04 17:03:52 +01:00
Chris Smowton
2a863fbbe7
Abbreviate protobuf package names
2020-09-04 17:03:52 +01:00
Chris Smowton
18ed6bd1ee
Add missing qldoc
2020-09-04 17:03:52 +01:00
Chris Smowton
90915284ba
Move getUnderlyingNode into Protobuf.qll
...
This is its only user for now.
2020-09-04 17:03:52 +01:00
Chris Smowton
59f9c6073d
Introduce instruction type for component access
...
This is the union of a field-access and an element-access instruction
2020-09-04 17:03:52 +01:00
Chris Smowton
455cf0c502
Add support and tests for protobuf messages with map fields
2020-09-04 17:03:52 +01:00
Chris Smowton
b2d4e2692f
Taint underlying aggregates of protobuf messages when an element is written
...
For example, writing to a[b].c[d] taints 'a'.
2020-09-04 17:03:52 +01:00
Chris Smowton
3d82308e07
Introduce common base class for ElementReadNode and FieldReadNode
2020-09-04 17:03:52 +01:00
Chris Smowton
56f6e67671
Protobufs: improve comment and code style
...
No functional changes
2020-09-04 15:14:49 +01:00
Chris Smowton
65dc6272d1
Remove prototype tests
...
I don't think we need these when we have the end-to-end taintFlows test.
2020-09-04 15:14:49 +01:00
Chris Smowton
b639b6ec6a
Remove redundant copies of the generated protoc output
2020-09-04 15:14:49 +01:00
Chris Smowton
8058d096d2
Model and test UnmarshalOptions.Unmarshal
...
Support for UnmarshalOptions.UnmarshalState is dropped for now as too hard to model.
2020-09-04 15:14:49 +01:00
Chris Smowton
c2ff2df403
Add test showing false-negative for MarshalState
2020-09-04 15:14:49 +01:00
Chris Smowton
42d6250b8d
Add modern-API variants of tests
2020-09-04 15:14:49 +01:00
Chris Smowton
8682eb9dec
Add tests showing imprecision of our current implementation
2020-09-04 15:14:49 +01:00
Chris Smowton
a832342ecb
Add test for unmarshalling submessages
2020-09-04 15:14:49 +01:00
Chris Smowton
596204f79d
Add (currently-failing) expectations for submessage tainting
2020-09-04 15:14:49 +01:00
Chris Smowton
c9296abe25
Restrict tainting from field-writes to Message types
2020-09-04 15:14:49 +01:00
Chris Smowton
95798590ce
Implement MarshalState method
...
Currently relies on blanket field-write propagation.
2020-09-04 15:14:49 +01:00
Chris Smowton
c34fc3c9ad
Add tests for MarshalAppend and MarshalState
...
The MarshalState test doesn't work yet, because we don't know to read taint from the Message field of the input or write it to the Buf field of the output
2020-09-04 15:14:49 +01:00
Chris Smowton
2ca6157836
Protobuf: support both legacy and modern APIs
2020-09-04 15:14:49 +01:00
Chris Smowton
df0238a352
Fix proto.Clone method
...
This is top-level, not a member.
2020-09-04 15:14:49 +01:00
Chris Smowton
e76c07d77b
Temporarily taint all structs from field writes
...
This should be either refined to just Message types, or else a macro taint step should be added conducting taint from field-write-of-argument to Marshal's result.
On the read-side we're currently fine: the bytes are tainted, so the object is tainted, so the field reads are tainted.
2020-09-04 15:14:49 +01:00
Chris Smowton
19e1dacced
WIP: add more (manual) protobuf models, and a test that checks various taint-flow cases
...
Only some of the cases are currently working.
2020-09-04 15:14:49 +01:00
Sauyon Lee
4ff325aa13
--wip-- [skip ci]
2020-09-04 15:14:49 +01:00
Max Schaefer
25e4245568
Merge pull request #291 from smowton/smowton/admin/oauth2-query-polish
...
Promote OAuth2-misuse query to mainline
2020-09-04 10:50:31 +01:00
Max Schaefer
c7b4db8d16
Merge pull request #319 from aeisenberg/patch-1
...
Update devcontainer memory settings
2020-09-03 14:31:11 +01:00
Andrew Eisenberg
2e8e970978
Update devcontainer memory settings
...
CodeQL CLI needs a minimum of 2G of memory. By default, the memory used is slightly less than that, leading to poor performance.
This change also removes two old, unused settings.
2020-09-02 12:07:05 -07:00
Chris Smowton
b487799f69
Oauth2 state query: avoid duplicate paths by excluding variable references as sources
2020-09-02 17:40:53 +01:00
Chris Smowton
6fea8abd82
Oauth2 state query: improve code style
...
No behavioural changes intended.
2020-09-02 15:06:23 +01:00
Chris Smowton
2f175e365e
Oauth2 state query: remove unnecessary isSource overload
2020-09-02 15:05:22 +01:00
Chris Smowton
8f99972833
OAuth2 CSRF query: improve documentation
2020-09-02 15:05:22 +01:00
Chris Smowton
0ba42f7f87
OAuth2 state query: set precision
2020-09-02 15:05:22 +01:00
Chris Smowton
406ea741f4
Improve comment style
2020-09-02 15:05:22 +01:00
Chris Smowton
faf43efb60
Promote OAuth2 constant-state query to mainline
2020-09-02 15:05:22 +01:00
Chris Smowton
0ee7bbbaa7
Extend oauth2 tests
2020-09-02 15:05:21 +01:00
Chris Smowton
f61c62d2d8
Generalise isReturnedWithError
...
It now recognises any function returning an Error alongside other return values
2020-09-02 15:05:21 +01:00
Chris Smowton
9e4ee0accf
OAuth2 constant state query: trace local URLs across reference operations and Sprintf calls
2020-09-02 15:05:21 +01:00
Chris Smowton
050a823397
OAuth2 exclusion: hide cases that clearly target an out-of-band process or private HTTP server
2020-09-02 15:05:21 +01:00
Chris Smowton
bcb65157e6
Oauth2-state query: treat log calls the same as stdout printers
...
These presumably get to the user somehow, and in conjunction with stdin use are enough to identify use of oauth at the terminal.
2020-09-02 15:05:21 +01:00
Chris Smowton
3d877fc67d
Oauth2 state: note bufio.NewScanner is also a sign of probable terminal-interactive use
2020-09-02 15:05:21 +01:00
Chris Smowton
6fee4f382f
Constant-oauth2-state: exclude strings returned alongside an error value
...
For example, getState() { ... return "", someError } is commonly seen in the wild.
2020-09-02 15:05:21 +01:00
Chris Smowton
aac303c0a2
Merge pull request #287 from smowton/smowton/feature/restore-repo-after-build
...
Restore repo layout post-autobuild
2020-09-02 13:38:36 +01:00
Chris Smowton
246e8b1b27
Make failure to restore a file to its original location non-fatal
2020-09-02 11:44:43 +01:00
Chris Smowton
8de188a6ca
Restore repo layout post-autobuild
2020-09-02 11:44:43 +01:00
Max Schaefer
be64f3ed22
Merge pull request #316 from gagliardetto/standard-lib-pt-17
...
Move `path` and `path/filepath` packages to stdlib
2020-09-02 08:26:11 +01:00
Slavomir
386005d361
Add path and path/filepath packages to stdlib
2020-09-01 13:09:41 +02:00
Sauyon Lee
976151c08f
Merge pull request #315 from max-schaefer/fix-frontend-errors
...
Fix frontend errors in test.
2020-08-28 12:40:11 -07:00
Max Schaefer
2fe8fb9d83
Fix frontend errors in test.
2020-08-28 12:01:33 +01:00