Skip to content

Fix bug caused by empty entrypoints

Hua Yan requested to merge fix_bug423542 into master

What does this MR do?

Fixed bug #423542

  • handled empty entrypoints in AndroidManifest.xml
  • added an integration test for the bug

Bug description: When the source code is missing in the 'entrypoint' of the project being test, Mobsf cannot handle it correctly and will report an internal error. A test case is a project with only an AndroidManifest.xml which consists only of an empty <manifest /> element.

Multiple options as suggested in #423542:

  1. When collecting the AndroidManifest.xml entrypoints, make sure that the manifest refers to actual entrypoints.
  2. When creating the scan payload, skip entrypoints without any code
  3. Add a environment variable SAST_MOBSF_EXCLUDE_ENTRYPOINTS which allows the user to skip specific entrypoints
  4. Ignore the errors from MobSF service.

Solution: Options 1 & 2 are basically the same in implementation, which fundamentally solve the problem. Option 3 adds some work for the customer, so is the best if we can do options 1 & 2. Option 4 is workaround that wraps the problem, and changes the design of our mobsf wrapper. We go with options 1 & 2 in the fix.

What are the relevant issue numbers?

#423542

Does this MR meet the acceptance criteria?

Edited by Hua Yan

Merge request reports