Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit 0445517

Browse files
emargolisrobszewczyk
authored andcommitted
Prevent Out-Of-Bound (OOB) Read Vulnerability in Camera Legacy Pairing Protocol.
Within the DropcamLegacyPairingServer::HandleCameraAuthDataRequest() method: -- Added check that the length of the nonce string encoded in the CameraAuthDataRequest message is 64 bytes. -- Added check that the TLV encoding for CameraAuthDataRequest contains no additional fields other than the nonce string. This change addresses CVE security vulnerability: CVE-2019-5034
1 parent ec4a537 commit 0445517

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/lib/profiles/vendor/nestlabs/dropcam-legacy-pairing/DropcamLegacyPairing.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ WEAVE_ERROR DropcamLegacyPairingServer::HandleCameraAuthDataRequest(ExchangeCont
374374
uint8_t macAddress[EUI48_LEN];
375375
uint8_t secret[CAMERA_SECRET_LEN];
376376
const uint8_t *noncePtr;
377+
uint32_t nonceLen;
377378
TLVReader reader;
378379
TLVWriter writer;
379380

@@ -391,6 +392,12 @@ WEAVE_ERROR DropcamLegacyPairingServer::HandleCameraAuthDataRequest(ExchangeCont
391392
err = reader.GetDataPtr(noncePtr);
392393
SuccessOrExit(err);
393394

395+
nonceLen = reader.GetLength();
396+
VerifyOrExit(nonceLen == CAMERA_NONCE_LEN, err = WEAVE_ERROR_INVALID_ARGUMENT);
397+
398+
err = reader.Next();
399+
VerifyOrExit(err == WEAVE_END_OF_TLV, err = WEAVE_ERROR_UNEXPECTED_TLV_ELEMENT);
400+
394401
// Get camera MAC address
395402
err = mDelegate->GetCameraMACAddress(macAddress);
396403
SuccessOrExit(err);

0 commit comments

Comments
 (0)