Skip to content

Added/Updated Android Network Knowledge, Test and Demo#3617

Draft
bernhste wants to merge 17 commits into
OWASP:masterfrom
bernhste:Android-Neworking-Know-Test-Demo
Draft

Added/Updated Android Network Knowledge, Test and Demo#3617
bernhste wants to merge 17 commits into
OWASP:masterfrom
bernhste:Android-Neworking-Know-Test-Demo

Conversation

@bernhste

@bernhste bernhste commented Jan 9, 2026

Copy link
Copy Markdown
Collaborator

Description

Expanded on the Android Networking:

  • Updated MASTG-TEST-0238
  • Created MASTG-KNOW-0109
  • Created MASTG-DEMO-0082
  • Created MASTG-BEST-0028

Follow up from #3030.


AI Tool Disclosure

  • My contribution includes AI-generated content, as disclosed below:
    • AI Tools: kagi assistant
    • LLMs and versions: Claude 4.5 Sonnet]
    • Prompts: Mostly to expand lists such as lists of insecure URI schemes. No AI for the text.

  • I have read the contributing guidelines.

@bernhste

Copy link
Copy Markdown
Collaborator Author

@cpholguera Thanks for linking the issue. Should we make a new issue for this one?


If you develop native code using the [Android Native Development Kit (NDK)](https://developer.android.com/ndk), you will not have access to high level network libraries.

You, or any networking library you use, can still directly use POSIX sockets. However, @MASTG-KNOW-0014 will not apply automatically.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is supported in Android by directly providing POSIX sockets. However, the restrictions of the @MASTG-KNOW-0014 like the prohibited use of clear text traffic will not apply automatically.


You, or any networking library you use, can still directly use POSIX sockets. However, @MASTG-KNOW-0014 will not apply automatically.

Some applications, like games or streaming apps, require low latency network connections. Hence they often provide their own native network stack.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Move this sentence above the previous sentence.

Schemes("stun", "stuns")
)

schemes.forEach { scheme ->

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This function looks a bit too long. Can you divide the tests into smaller functions, focusing on individual test cases?


You, or any networking library you use, can still directly use POSIX sockets. However, @MASTG-KNOW-0014 will not apply automatically.

Some applications, like games or streaming apps, require low latency network connections. Hence they often provide their own native network stack.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I would move this sentence above the previous one


If you develop native code using the [Android Native Development Kit (NDK)](https://developer.android.com/ndk), you will not have access to high level network libraries.

You, or any networking library you use, can still directly use POSIX sockets. However, @MASTG-KNOW-0014 will not apply automatically.

@wischbgr wischbgr Apr 27, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Android allows this by giving apps the possibility to directly use low level Java or POSIX sockets for networking. However in case of not using the high level Java/Kotlin networking APIs, @MASTG-KNOW-0014 will not be able to enforce limitations such as blocking clear text traffic.

- Addresses, which are networking identifiers, like IP addresses.
- Sockets, which are basic bidirectional data communication mechanisms.
- Interfaces, which describe network interfaces.

@wischbgr wischbgr Apr 27, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I would somewhere mention the difference between URI and URL. It might not be widely known and is also a bit strange in the Android ecosystem.

A URL specifies the location of a resource on the internet, while a URI can be used to identify any type of resource, not just those on the internet. It can for example be also an app local resource or file.


## Native Code Networking

When developing native code using the Android NDK toolset, there are no libraries available by default which implement protocols above the transport layer. Instead, developers can use the POSIX API directly to initialize sockets. [NDK Networking API](https://developer.android.com/ndk/reference/group/networking) on the other hand provides additional functions for address lookups for example.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"available by default" meaning provided by Android? Afaik libs such as libcurl are available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants