The vulnerable system is bound to the network stack and the set of possible attackers extends beyond the other options listed below, up to and including the entire Internet. Such a vulnerability is often termed “remotely exploitable” and can be thought of as an attack being exploitable at the protocol level one or more network hops away (e.g., across one or more routers). An example of a network attack is an attacker causing a denial of service by sending a specially crafted TCP packet across a wide area network (e.g., CVE-2004-0230).
Attack Complexity
High
AC
The successful attack depends on the evasion or circumvention of security-enhancing techniques in place that would otherwise hinder the attack. These include: Evasion of exploit mitigation techniques. The attacker must have additional methods available to bypass security measures in place. For example, circumvention of address space randomization (ASLR) or data execution prevention must be performed for the attack to be successful. Obtaining target-specific secrets. The attacker must gather some target-specific secret before the attack can be successful. A secret is any piece of information that cannot be obtained through any amount of reconnaissance. To obtain the secret the attacker must perform additional attacks or break otherwise secure measures (e.g. knowledge of a secret key may be needed to break a crypto channel). This operation must be performed for each attacked target.
Privileges Required
High
PR
The attacker requires privileges that provide significant (e.g., administrative) control over the vulnerable system allowing full access to the vulnerable system’s settings and files.
Scope
S
An exploited vulnerability can affect resources beyond the security scope managed by the security authority that is managing the vulnerable component. This is often referred to as a 'privilege escalation,' where the attacker can use the exploited vulnerability to gain control of resources that were not intended or authorized.
Confidentiality
High
C
There is total information disclosure, resulting in all data on the system being revealed to the attacker, or there is a possibility of the attacker gaining control over confidential data.
Integrity
High
I
There is a total compromise of system integrity. There is a complete loss of system protection, resulting in the attacker being able to modify any file on the target system.
Availability
High
A
There is a total shutdown of the affected resource. The attacker can deny access to the system or data, potentially causing significant loss to the organization.
Android system_server Code Loading BypassAndroid: Code loading bypasses in system_server
As of Android Nougat, a new set of SELinux rules have been added which are designed to prevent system_server from loading arbitrary code into its address-space. This has been enforced by adding the following rules to system_server's SELinux policy:
neverallow system_server self:process execmem;
neverallow system_server ashmem_device:chr_file execute;
neverallow system_server system_server_tmpfs:file execute;
However, as system_server is extremely privileged, there are a few vectors through which it may still load arbitrary code, thus bypassing the mitigation mentioned above.
1. The system user has read-write access to /data/app/*/oat/*. However, this directory and all files created within it have the SELinux context:
u:object_r:dalvikcache_data_file:s0
(see http://androidxref.com/7.0.0_r1/xref/system/sepolicy/file_contexts#252)
Since system_server is required to execute dalvik-cache files, its SELinux policy explicitly allows this by adding the rule:
allow system_server dalvikcache_data_file:file execute;
This means that system_server may create a file under the aforementioned path and mmap it with PROT_EXEC in order to load arbitrary code.
2. Much in the same way, system_server has read-write access to /data/app, including /data/app/vmdl*.tmp/*/oat/*. However, this directory and all files created within it have the SELinux context:
u:object_r:dalvikcache_data_file:s0
(see http://androidxref.com/7.0.0_r1/xref/system/sepolicy/file_contexts#254)
This allows the attacker to follow the same steps as in (1.) in order to map in arbitrary code.
Note that removing RW access to the oat directories is not always sufficient to fix this issue. For example, an attacker can also choose to store his code within the his application (i.e., in a large byte[] within the source code). This in turn will be compiled into the ODEX file under the "oat" directory, and can then be used to map in arbitrary code once more into system_server.
This bug is subject to a 90 day disclosure deadline. If 90 days elapse without a broadly available patch, then the bug report will automatically become visible to the public.
Found by: laginimaineb
This information is provided for TESTING and LEGAL RESEARCH purposes only. All trademarks used are properties of their respective owners. By visiting this website you agree to Terms of Use and Privacy Policy and Impressum