aws / aws/aws-dynamodb-encryption-java

NPE if using CachingMostRecentProvider to decrypt records without "amzn-ddb-meta-id"

Open
#144 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
141
Forks
74
PR merge metrics
No merged PRs in 30d

Description

### Problem:

If a user attempts to use a CachingMostRecentProvider to decrypt a record that *does* contain a mat-desc, but that mat-desc does not contain the key value "amzn-ddb-meta-id," they get an NPE. This can happen if a user tries to encrypt with another one of our providers then decrypt with the CachingMostRecentProvider.

### Solution:

Instead, users should get a more friendly error that decryption was unable to succeed.

### Out of scope:

The CachingMostRecentProvider is not intended to interoperate with other providers.

[//]: # (NOTE: If you believe this might be a security issue, please email aws-security@amazon.com instead of creating a GitHub issue. For more details, see the AWS Vulnerability Reporting Guide: https://aws.amazon.com/security/vulnerability-reporting/ )

Contributor guide

Open the contributing guide

Research direction

Start at the CachingMostRecentProvider decryption path described in the issue and trace how a mat-desc without "amzn-ddb-meta-id" is handled. Reproduce the case using a record encrypted by another provider, then verify that decryption fails with a friendly error rather than an NPE.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.