Skip to content

Conversation

@Diolor
Copy link
Collaborator

@Diolor Diolor commented Oct 6, 2025

This PR closes #2977

Description

Migration to v2.

TODOS

  • Allocate TEST ID
  • Allocate DEMO ID
  • MASTG-TEST-02te is now static. Evaluate if dynamic testing can be added
  • Evaluate if truly semgrem cannot parse annotation like @JavascriptInterface to add in the rule

Comment on lines 11 to 12
- pattern: $WEBVIEW.addJavascriptInterface($BRIDGE, $NAME)
- pattern: "@JavascriptInterface $RETURN_TYPE $FUNCTION (...){...}" No newline at end of file
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I tried to match the whole Bridge class with a pattern like the following, but without much success

  patterns:
    - pattern: $_.addJavascriptInterface(new $BRIDGE (...), $_)
    - pattern: class $BRIDGE { ... }

@ScreaMy7
Copy link
Collaborator

@cpholguera @sushi2k Can you please assign the review to me.

## Steps

1. Use a tool like @MASTG-TOOL-0110 to search for references to:
- `usesCleartextTraffic` option in the AndroidManifest.xml file
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this be irrelevant for the specific purpose of this test?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Reasoning is at L15
The weakness could become a vulnerability if the WebView allows unencrypted (non-TLS) traffic (i.e., HTTPS) in combination with an XSS attack.

We could narrow the scope to "focus only on the bridges" and point to MASTG-TEST-0235 for confidentiality

Copy link
Collaborator

Choose a reason for hiding this comment

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

That'd be better, I think. Data can be exfiltrated even through secure connections.

@cpholguera
Copy link
Collaborator

@ScreaMy7 we will once it's ready for review. For now it's still in DRAFT. Thank you!

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.

MASTG v1->v2 MASTG-TEST-0033: Testing for Java Objects Exposed Through WebViews (android)

3 participants