lcimeni / lcimeni/cookie

NowSecure static analysis: Not Using Built-in Binary Protection (ASLR/PIC) Exposes Components to Memory Corruption Attacks

Open
#263 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement nowsecure
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Finding Description

ASLR/PIC protection is not implemented for certain components of the binary package.
ASLR (Address space layout randomization) is a security feature introduced in Android that randomizes how an app is loaded and maintained in memory.
ASLR/PIC randomizes the address space used in the application, making it difficult to execute malicious code without first causing the application to crash.
It also complicates the process of dumping allocated memory of the application.
This is a best practice as it is free and does not impact functionality of the app but does harden the app from a security perspective.
Buffer overflow exploits have led to severe vulnerabilities such as the major WhatsApp remote takeover vulnerability in 2019

Evaluation Criteria

This is a warning as some of the components listed in the context table below may be 3rd party or unable to be remediated.
The table should be checked and a determination made if remediation is possible for the affected components.

Steps to Reproduce

This test examines the individual components of the compiled binary to see if they were compiled using Position Independent Code (PIC).

Business Impact

Libraries in this app do not protect against a specific type of attack that can allow an attacker to execute unintended actions.
These custom actions could potentially give them access to sensitive information from the app or the device.

Remediation Resources

Because the Android NDK handles this automatically, it may be worthwhile to switch over to using that capability to manage native libraries.
More information can be found at https://developer.android.com/ndk.

If using the provided NDK is not an option, then the issue is likely in the compiler settings for the native libraries that caused the vulnerability to pop up.
Make sure that the -fstack-protector-all and -fpic flags are set in the build.gradle file (typically in the cmake/cppFlags).

The third possibility is that there is a third party library causing this problem.
As an example the hybrid framework Flutter will not compile using stack canaries because of the way Dart mitigates buffer overflows.
The libraries and their mitigations should be evaluated and handled according to the company's security standards.

Risk and Regulatory Information

Severity: low
CVSS: 1.6

Application
  • Platform: android
  • Package: com.disney.disneyplus

See more detail in the NowSecure Report

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the compiled binary components identified by the NowSecure report, then inspect build.gradle and the cmake/cppFlags settings for project-built native libraries. Determine whether each affected component is project-owned or third-party and whether remediation is possible; done means the applicable libraries are rebuilt with the required protection or documented as unable to be remediated.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, cmake, cpp
Domain
build-system, mobile, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.