-
Notifications
You must be signed in to change notification settings - Fork 1.8k
C#/Java/C++: Add change note for #3110 #3421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
calumgrant
merged 5 commits into
github:master
from
hvitved:csharp/dataflow/change-note
May 13, 2020
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Improvements to C/C++ analysis | ||
|
||
The following changes in version 1.25 affect C/C++ analysis in all applications. | ||
|
||
## General improvements | ||
|
||
## New queries | ||
|
||
| **Query** | **Tags** | **Purpose** | | ||
|-----------------------------|-----------|--------------------------------------------------------------------| | ||
|
||
## Changes to existing queries | ||
|
||
| **Query** | **Expected impact** | **Change** | | ||
|----------------------------|------------------------|------------------------------------------------------------------| | ||
|
||
## Changes to libraries | ||
|
||
* The data-flow library has been improved, which affects most security queries by potentially | ||
adding more results. Flow through functions now takes nested field reads/writes into account. | ||
For example, the library is able to track flow from `taint()` to `sink()` via the method | ||
`getf2f1()` in | ||
```c | ||
struct C { | ||
int f1; | ||
}; | ||
|
||
struct C2 | ||
{ | ||
C f2; | ||
|
||
int getf2f1() { | ||
return f2.f1; // Nested field read | ||
} | ||
|
||
void m() { | ||
f2.f1 = taint(); | ||
sink(getf2f1()); // NEW: taint() reaches here | ||
} | ||
}; | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,5 +24,28 @@ The following changes in version 1.25 affect C# analysis in all applications. | |
have type parameters. This means that non-generic nested types inside construced types, | ||
such as `A<int>.B`, no longer are considered unbound generics. (Such nested types do, | ||
however, still have relevant `.getSourceDeclaration()`s, for example `A<>.B`.) | ||
* The data-flow library has been improved, which affects most security queries by potentially | ||
adding more results. Flow through methods now takes nested field reads/writes into account. | ||
For example, the library is able to track flow from `"taint"` to `Sink()` via the method | ||
`GetF2F1()` in | ||
```csharp | ||
class C1 | ||
{ | ||
string F1; | ||
} | ||
|
||
class C2 | ||
{ | ||
C1 F2; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is an extra line here. |
||
string GetF2F1() => F2.F1; // Nested field read | ||
|
||
void M() | ||
{ | ||
F2 = new C1() { F1 = "taint" }; | ||
Sink(GetF2F1()); // NEW: "taint" reaches here | ||
} | ||
} | ||
``` | ||
|
||
## Changes to autobuilder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Improvements to Java analysis | ||
|
||
The following changes in version 1.25 affect Java analysis in all applications. | ||
|
||
## General improvements | ||
|
||
## New queries | ||
|
||
| **Query** | **Tags** | **Purpose** | | ||
|-----------------------------|-----------|--------------------------------------------------------------------| | ||
|
||
|
||
## Changes to existing queries | ||
|
||
| **Query** | **Expected impact** | **Change** | | ||
|------------------------------|------------------------|-----------------------------------| | ||
|
||
|
||
## Changes to libraries | ||
|
||
* The data-flow library has been improved, which affects most security queries by potentially | ||
adding more results. Flow through methods now takes nested field reads/writes into account. | ||
For example, the library is able to track flow from `"taint"` to `sink()` via the method | ||
`getF2F1()` in | ||
```java | ||
class C1 { | ||
String f1; | ||
C1(String f1) { this.f1 = f1; } | ||
} | ||
|
||
class C2 { | ||
C1 f2; | ||
String getF2F1() { | ||
return this.f2.f1; // Nested field read | ||
} | ||
void m() { | ||
this.f2 = new C1("taint"); | ||
sink(this.getF2F1()); // NEW: "taint" reaches here | ||
} | ||
} | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the example might read better if
C1
andF1
could be replaced by real-world examples likePerson
andSurname
. Just an idea.