Skip to content

Add Quark Script APIs to detect CWE-926#379

Merged
pulorsok merged 8 commits into
ev-flow:masterfrom
haeter525:feat/quark_script_for_cwe_926
Sep 12, 2022
Merged

Add Quark Script APIs to detect CWE-926#379
pulorsok merged 8 commits into
ev-flow:masterfrom
haeter525:feat/quark_script_for_cwe_926

Conversation

@haeter525

@haeter525 haeter525 commented Aug 26, 2022

Copy link
Copy Markdown
Member

Description

Please refer to #324.

This PR adds the following three Quark script APIs to detect improper export of Android activities(CWE-926).

  1. getActivities(samplePath)
  2. activityInstance.hasIntentFilter(None)
  3. activityInstance.isExported(None)

Test Plans

  • All tests passed

@pep8speaks

pep8speaks commented Aug 26, 2022

Copy link
Copy Markdown

Hello @haeter525! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 2:80: E501 line too long (82 > 79 characters)

Line 2:80: E501 line too long (82 > 79 characters)

Comment last updated at 2022-09-11 06:50:29 UTC

@codecov-commenter

codecov-commenter commented Aug 26, 2022

Copy link
Copy Markdown

Codecov Report

Base: 77.06% // Head: 77.92% // Increases project coverage by +0.85% 🎉

Coverage data is based on head (ec4c67d) compared to base (871e798).
Patch coverage: 98.22% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #379      +/-   ##
==========================================
+ Coverage   77.06%   77.92%   +0.85%     
==========================================
  Files          60       62       +2     
  Lines        4470     4629     +159     
==========================================
+ Hits         3445     3607     +162     
+ Misses       1025     1022       -3     
Flag Coverage Δ
unittests 77.92% <98.22%> (+0.85%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
quark/core/interface/baseapkinfo.py 80.00% <80.00%> (ø)
quark/core/apkinfo.py 90.20% <87.50%> (-0.24%) ⬇️
quark/core/axmlreader/__init__.py 89.32% <97.59%> (+5.78%) ⬆️
quark/core/rzapkinfo.py 76.15% <100.00%> (+0.43%) ⬆️
quark/script/__init__.py 95.00% <100.00%> (+0.73%) ⬆️
tests/conftest.py 100.00% <100.00%> (ø)
tests/core/test_apkinfo.py 95.79% <100.00%> (+0.18%) ⬆️
tests/core/test_axmlreader.py 100.00% <100.00%> (ø)
tests/script/test_script.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@haeter525 haeter525 force-pushed the feat/quark_script_for_cwe_926 branch 3 times, most recently from e254a4e to 0da3999 Compare August 26, 2022 08:18
@lgtm-com

lgtm-com Bot commented Aug 26, 2022

Copy link
Copy Markdown

This pull request introduces 1 alert when merging a099105 into 2ce703f - view on LGTM.com

new alerts:

  • 1 for Module imports itself

@haeter525 haeter525 force-pushed the feat/quark_script_for_cwe_926 branch from 9e0d525 to da4a359 Compare August 26, 2022 09:30
@pulorsok

pulorsok commented Sep 10, 2022

Copy link
Copy Markdown
Member

Hi @haeter525 , thank you for the PR.
I noticed that you are not writing docstring for properties and private methods.
However, I think the properties and private methods all need to have a docstring to describe what they do.
That will help users/contributors to understand our codebase quickly.

Also, the file tests/script/test_script.py is conflicting with master branch. Please resolve it.

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.

4 participants