exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Samsung OTP OTP_GET_CRYPTO_DERIVED_KEY Buffer Overflow

Samsung OTP OTP_GET_CRYPTO_DERIVED_KEY Buffer Overflow
Posted Jan 3, 2017
Authored by Google Security Research, laginimaineb

Stack buffer overflow and information disclosure vulnerabilities exist in the Samsung OTP TrustZone trustlet via OTP_GET_CRYPTO_DERIVED_KEY.

tags | advisory, overflow, vulnerability, info disclosure
SHA-256 | 4be8f76a129448aa3f0cabbae41989cd16d89dc95b8f9b129a48d198c0e109be

Samsung OTP OTP_GET_CRYPTO_DERIVED_KEY Buffer Overflow

Change Mirror Download
 Stack buffer overflow and information disclosure in OTP TrustZone trustlet via OTP_GET_CRYPTO_DERIVED_KEY 




As a part of the KNOX extensions available on Samsung devices, Samsung provides a TrustZone trustlet which allows the generation of OTP tokens.

The tokens are generated in a TrustZone application within the TEE (UID: fffffffff0000000000000000000001e), which can be communicated with using the "OTP" service, published by "otp_server".

The command "OTP_GET_CRYPTO_DERIVED_KEY" allows the user to generate a key using a KDF which is based on a previously unwrapped OTP token. However, after unwrapping the supplied OTP token, the command fails to validate the derived key length field (at offset 1128 in the request buffer). This argument is then passed on to the KDF, and may be arbitrarily large.

Supplying a large value for the derived key length field will cause the KDF function to overwrite the destination buffer with the derived key bytes. As the destination buffer in located on the stack, this will allow the attack to overwrite important stack data.

Since HMAC-SHA1/HMAC-SHA256 are PRFs and the password in the token is unknown to the attacker, this issue would be harder to exploit on its own (would require to blindly brute-force the destination bytes). However, the "otp_get_crypto_derived_key" function also contains an information disclosure vulnerability that would allow the attacker to leak the derived key for each attempt.

After calling the KDF, the aforementioned length field is used as the length argument in a "memcpy" call which copies the generated bytes into the user's response buffer, thus leaking the generated bytes back to the Non-Secure World.

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

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close