Skip to content

KernelSU signature validation mismatch

High
tiann published GHSA-86cp-3prf-pwqq Oct 26, 2023

Package

me.weishu.kernelsu

Affected versions

>0.6.1

Patched versions

0.7.0

Description

Impact

If a KernelSU installed device is infected with a malware whose app signing block specially constructed, it can take over root privileges on the device.

Description

  1. The current verification logic actually obtains the signature of the last block with an id of 0x7109871a, while the verification logic during Android installation is to obtain the first one.
  2. In addition to the actual signature upgrade that has been fixed (KSU thought it was V2 but was actually V3), there is also the problem of actual signature downgrading (KSU thought it was V2 but was actually V1). Find a condition in the signature verification logic that will cause the signature not to be found error, and KernelSU does not implement the same conditions, so KSU thinks there is a V2 signature, but the APK signature verification actually uses the V1 signature.

Patches

Not patched

Workarounds

  1. Keep the KernelSU manager installed
  2. Don't install unknown apps

References

  1. similar cve: CVE-2023-5521

PoC

https://drive.google.com/drive/folders/1XdYCCAhC_mkt1k1IyUiwcgFsuOFvwNRl

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H

CVE ID

CVE-2023-46139

Weaknesses

No CWEs

Credits