# GHSA-72fp-w44g-625q: Signing DynamoDB Sets when using the AWS Database Encryption SDK.

> Signature validation failures occur for DynamoDB Sets marked SIGN_ONLY, causing read errors and potential denial of service for applications using the library.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 9 Nov 2023

## What is GHSA-72fp-w44g-625q?

GHSA-72fp-w44g-625q is a vulnerability in software.amazon.cryptography:aws-database-encryption-sdk-dynamodb, published on 9 Nov 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

### Impact
This advisory addresses an issue when a DynamoDB Set attribute is marked as SIGN_ONLY in the AWS Database Encryption SDK (DB-ESDK) for DynamoDB. This also includes when a Set is part of a List or a Map.

DB-ESDK for DynamoDB supports `SIGN_ONLY` and `ENCRYPT_AND_SIGN` attribute actions. In version 3.1.0 and below, when a Set type is assigned a `SIGN_ONLY` attribute action, there is a chance that signature validation of the record containing a Set will fail on read, even if the Set attributes contain the same values. The probability of a failure depends on the order of the elements in the Set combined with how DynamoDB returns this data, which is undefined.

This update addresses the issue by ensuring that any Set values are canonicalized in the same order while written to DynamoDB as when read back from DynamoDB.

### Patches
Fixed in version 3.1.1 
We recommend all users upgrade as soon as possible.

### Workarounds
None

### References
For more information on how to address records with Sets marked as `SIGN_ONLY` written by versions 3.1.0 and below of DB-ESDK, see [AWS Database Encryption SDK Decrypt with Permute](https://github.com/aws/aws-database-encryption-sdk-dynamodb-java/tree/v3.1.1/DecryptWithPermute)

## Which versions are affected by GHSA-72fp-w44g-625q?

2 open source packages ship an affected version, including software.amazon.cryptography:aws-database-encryption-sdk-dynamodb.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `software.amazon.cryptography:aws-database-encryption-sdk-dynamodb` | Maven | From 3.0.0 | 3.1.1 |
| `software.amazon.cryptography:aws-database-encryption-sdk-dynamodb` | Maven | From 3.0.0 | 3.1.1 |

## How do I fix GHSA-72fp-w44g-625q?

Upgrade software.amazon.cryptography:aws-database-encryption-sdk-dynamodb to 3.1.1 or later.

## Is GHSA-72fp-w44g-625q being exploited?

There is no known exploitation of GHSA-72fp-w44g-625q in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-72fp-w44g-625q and fix it if it is affected.

What it is: GHSA-72fp-w44g-625q is a vulnerability in software.amazon.cryptography:aws-database-encryption-sdk-dynamodb, published on 9 Nov 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-72fp-w44g-625q in the wild and no public exploit code.

Affected packages and fixed versions:
- software.amazon.cryptography:aws-database-encryption-sdk-dynamodb (Maven): affected from 3.0.0; fixed in 3.1.1
- software.amazon.cryptography:aws-database-encryption-sdk-dynamodb (Maven): affected from 3.0.0; fixed in 3.1.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-72fp-w44g-625q/ (Markdown: https://insights.sbomify.com/GHSA-72fp-w44g-625q/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-72fp-w44g-625q

---
From sbomify Insights: https://insights.sbomify.com/GHSA-72fp-w44g-625q/
Summaries are generated and may contain mistakes; the official description above is the record.
