Improper Input Validation Affecting op-tee/optee_os package, versions [,3.19.0-rc1)


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.05% (23rd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-UNMANAGED-OPTEEOPTEEOS-3150940
  • published30 Nov 2022
  • disclosed30 Nov 2022
  • creditasafmod

Introduced: 30 Nov 2022

CVE-2022-46152  (opens in a new tab)
CWE-129  (opens in a new tab)

How to fix?

Upgrade op-tee/optee_os to version 3.19.0-rc1 or higher.

Overview

Affected versions of this package are vulnerable to Improper Input Validation in the cleanup_shm_refs() function in entry_std.c, which contains an out-of-bounds read involving the NUM_PARAMS argument. An attacker with permission to execute SMC instructions can exploit this to escalate privileges in the secure system.

PoC

Register   | Value
----------------------
x0         |   OPTEE_SMC_CALL_WITH_ARG
x1+x2      |   point to shared memory with the following struct:

struct optee_msg_arg {
    uint32_t cmd = OPTEE_MSG_CMD_INVOKE_COMMAND;
    uint32_t func;
    uint32_t session;
    uint32_t cancel_id;
    uint32_t pad;
    uint32_t ret;
    uint32_t ret_origin;
    uint32_t num_params = 127;
    struct optee_msg_param params[];
}

CVSS Scores

version 3.1