what you don't know can hurt you
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:

November 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close