Skip to content

Java: Improvements to UnsafeAndroidAccess#8537

Merged
atorralba merged 12 commits intogithub:mainfrom
atorralba:atorralba/unsafe_android_access_improvs
May 5, 2022
Merged

Java: Improvements to UnsafeAndroidAccess#8537
atorralba merged 12 commits intogithub:mainfrom
atorralba:atorralba/unsafe_android_access_improvs

Conversation

@atorralba
Copy link
Contributor

@atorralba atorralba commented Mar 23, 2022

Improves the query UnsafeAndroidAccess. When checking that the WebView for which loadUrl is called also has enabled JavaScript (and optionally file access), we weren't taking into account that it could be a ThisAccess instead of a Variable.

There's some code refactoring too (mainly moving predicates from UnsafeAndroidAccess.qll to WebView.qll).

@atorralba atorralba requested a review from a team as a code owner March 23, 2022 12:48
@github-actions github-actions bot added the Java label Mar 23, 2022
@github-actions
Copy link
Contributor

⚠️ The head of this PR and the base branch were compared for differences in the framework coverage reports. The generated reports are available in the artifacts of this workflow run. The differences will be picked up by the nightly job after the PR gets merged.

Click to show differences in coverage

java

Generated file changes for java

  • Changes to framework-coverage-java.rst:
-    Android,``android.*``,46,416,108,,,3,67,,,
+    Android,``android.*``,57,418,108,,,3,67,,,
-    Totals,,183,6225,1441,106,6,10,107,33,1,81
+    Totals,,194,6227,1441,106,6,10,107,33,1,81
  • Changes to framework-coverage-java.csv:
- android.webkit,3,2,,,,,,,,,,,,,,,,,,,,,,,,3,,,2,,
+ android.webkit,3,13,2,,,,,,,,,,,,,,,,,,,,,,,3,,,13,2,

@atorralba atorralba changed the title Improvements to UnsafeAndroidAccess Java: Improvements to UnsafeAndroidAccess Mar 23, 2022
@github-actions
Copy link
Contributor

⚠️ The head of this PR and the base branch were compared for differences in the framework coverage reports. The generated reports are available in the artifacts of this workflow run. The differences will be picked up by the nightly job after the PR gets merged.

Click to show differences in coverage

java

Generated file changes for java

  • Changes to framework-coverage-java.rst:
-    Android,``android.*``,46,416,108,,,3,67,,,
+    Android,``android.*``,57,418,108,,,3,67,,,
-    Totals,,183,6225,1441,106,6,10,107,33,1,81
+    Totals,,194,6227,1441,106,6,10,107,33,1,81
  • Changes to framework-coverage-java.csv:
- android.webkit,3,2,,,,,,,,,,,,,,,,,,,,,,,,3,,,2,,
+ android.webkit,3,13,2,,,,,,,,,,,,,,,,,,,,,,,3,,,13,2,

Copy link
Contributor

@smowton smowton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please expand the tests to include the new sources and models added here (or is this intended as just reorganisation that doesn't change behaviour?)

@github-actions
Copy link
Contributor

⚠️ The head of this PR and the base branch were compared for differences in the framework coverage reports. The generated reports are available in the artifacts of this workflow run. The differences will be picked up by the nightly job after the PR gets merged.

Click to show differences in coverage

java

Generated file changes for java

  • Changes to framework-coverage-java.rst:
-    Android,``android.*``,46,416,108,,,3,67,,,
+    Android,``android.*``,57,418,108,,,3,67,,,
-    Totals,,183,6225,1441,106,6,10,107,33,1,81
+    Totals,,194,6227,1441,106,6,10,107,33,1,81
  • Changes to framework-coverage-java.csv:
- android.webkit,3,2,,,,,,,,,,,,,,,,,,,,,,,,3,,,2,,
+ android.webkit,3,13,2,,,,,,,,,,,,,,,,,,,,,,,3,,,13,2,

@atorralba
Copy link
Contributor Author

Please expand the tests to include the new sources and models added here (or is this intended as just reorganisation that doesn't change behaviour?)

No, this indeed adds new functionality with the new sources and steps. Added the tests in
c6c72eb, thanks for pointing this out. It actually made me detect a mistake in the sources.

@github-actions
Copy link
Contributor

⚠️ The head of this PR and the base branch were compared for differences in the framework coverage reports. The generated reports are available in the artifacts of this workflow run. The differences will be picked up by the nightly job after the PR gets merged.

Click to show differences in coverage

java

Generated file changes for java

  • Changes to framework-coverage-java.rst:
-    Android,``android.*``,46,416,108,,,3,67,,,
+    Android,``android.*``,57,418,108,,,3,67,,,
-    Totals,,183,6225,1441,106,6,10,107,33,1,81
+    Totals,,194,6227,1441,106,6,10,107,33,1,81
  • Changes to framework-coverage-java.csv:
- android.webkit,3,2,,,,,,,,,,,,,,,,,,,,,,,,3,,,2,,
+ android.webkit,3,13,2,,,,,,,,,,,,,,,,,,,,,,,3,,,13,2,

@github-actions
Copy link
Contributor

⚠️ The head of this PR and the base branch were compared for differences in the framework coverage reports. The generated reports are available in the artifacts of this workflow run. The differences will be picked up by the nightly job after the PR gets merged.

Click to show differences in coverage

java

Generated file changes for java

  • Changes to framework-coverage-java.rst:
-    Android,``android.*``,46,416,108,,,3,67,,,
+    Android,``android.*``,57,418,108,,,3,67,,,
-    Totals,,183,6225,1441,106,6,10,107,33,1,81
+    Totals,,194,6227,1441,106,6,10,107,33,1,81
  • Changes to framework-coverage-java.csv:
- android.webkit,3,2,,,,,,,,,,,,,,,,,,,,,,,,3,,,2,,
+ android.webkit,3,13,2,,,,,,,,,,,,,,,,,,,,,,,3,,,13,2,

Copy link
Contributor

@smowton smowton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, just wants a DCA and a FP review. DCA will have to wait til next week; have you already checked with an lgtm all-projects run how many new hits we get and how many look like TPs?

@atorralba
Copy link
Contributor Author

have you already checked with an lgtm all-projects run how many new hits we get and how many look like TPs?

I did, and I don't like the results — the new sources add too many FPs. I've removed the CSV models from this PR and will create a specific PR for that, after giving it a second thought so that the FPs can be reduced.

@atorralba atorralba force-pushed the atorralba/unsafe_android_access_improvs branch from e3ac827 to ef1ef0c Compare March 29, 2022 08:39
@atorralba
Copy link
Contributor Author

FPs and DCA looking good now.

@atorralba
Copy link
Contributor Author

@smowton this PR was simplified, and FP ratio and performance look good, so I think it should be easy to re-review for a final approval.

smowton
smowton previously approved these changes May 3, 2022
Copy link
Contributor

@smowton smowton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks plausible

@atorralba atorralba force-pushed the atorralba/unsafe_android_access_improvs branch from 1821365 to 8601137 Compare May 4, 2022 09:59
@atorralba
Copy link
Contributor Author

Had to rebase to solve an error in the CI.

Copy link
Contributor

@aschackmull aschackmull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks plausible to me now.

@atorralba atorralba merged commit ca2959c into github:main May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants