# GHSA-g636-q5fc-4pr7: accounts: Hash account number using Salt

> Unsalted hashing of account numbers allows attackers to reverse hashes via rainbow tables, exposing sensitive customer data.

- **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:** 24 May 2021

## What is GHSA-g636-q5fc-4pr7?

GHSA-g636-q5fc-4pr7 is a vulnerability in github.com/moov-io/customers, published on 24 May 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

@alovak found that currently when we build hash of account number we do not "salt" it. Which makes it vulnerable to rainbow table attack.

**What did you expect to see?**
I expected salt (some random number from configuration) to be used in [hash.AccountNumber](https://github.com/moov-io/customers/blob/master/pkg/secrets/hash/account_number.go#L13)

I would generate salt per tenant at least (maybe per organization).

## Which versions are affected by GHSA-g636-q5fc-4pr7?

2 open source packages ship an affected version, including github.com/moov-io/customers.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/moov-io/customers` | Go | All versions | 0.5.0 |
| `github.com/moov-io/customers` | Go | All versions | 0.5.0 |

## How do I fix GHSA-g636-q5fc-4pr7?

Upgrade github.com/moov-io/customers to 0.5.0 or later.

## Is GHSA-g636-q5fc-4pr7 being exploited?

There is no known exploitation of GHSA-g636-q5fc-4pr7 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-g636-q5fc-4pr7 and fix it if it is affected.

What it is: GHSA-g636-q5fc-4pr7 is a vulnerability in github.com/moov-io/customers, published on 24 May 2021. 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-g636-q5fc-4pr7 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/moov-io/customers (Go): affected all versions; fixed in 0.5.0
- github.com/moov-io/customers (Go): affected all versions; fixed in 0.5.0

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-g636-q5fc-4pr7/ (Markdown: https://insights.sbomify.com/GHSA-g636-q5fc-4pr7/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-g636-q5fc-4pr7

---
From sbomify Insights: https://insights.sbomify.com/GHSA-g636-q5fc-4pr7/
Summaries are generated and may contain mistakes; the official description above is the record.
