# VNX-1391: Use of Weak Credentials: trivially guessable password literal

Reports a password set to a trivially guessable value (123456, qwerty, letmein, password123, admin123, p@ssw0rd, ...) in code, configuration files.

| Field | Value |
|---|---|
| Rule ID | `VNX-1391` |
| Severity | Low |
| SARIF level | `note` |
| Kind | `sast` |
| Languages | Python, JavaScript / TypeScript, Go, Java, PHP, Ruby, C#, Dockerfile, Config files |
| CWE | [CWE-1391](https://cwe.mitre.org/data/definitions/1391.html) |
| CAPEC | [CAPEC-16](https://capec.mitre.org/data/definitions/16.html) |
| ATT&CK | [T1110.001](https://attack.mitre.org/techniques/T1110/001/) |
| CWSS vector | `CWSS:1.0/TI:L/AP:A/AL:A/IC:N/FC:LT/RP:N/RL:A/AV:I/AS:N/IN:A/SC:A/BI:L/DI:H/EX:L/EC:N/P:L` |
| Tags | `weak-credential` `credentials` `cwe-1391` |
| Source | [`internal/sast/rules/vnx-1391.rego`](https://github.com/Vulnesis/cli/blob/main/internal/sast/rules/vnx-1391.rego) |

## Overview

VNX-1391 maps to [CWE-1391: Use of Weak Credentials](https://cwe.mitre.org/data/definitions/1391.html). A password from the top of every guessing wordlist falls to the first minutes of a brute-force or credential-spraying attempt. The rule reports a password-named key (ending in `password`, `passwd`, `pwd`, `passphrase` or `_pass`) whose value is an all-digit string of four or more digits, a keyboard walk (`qwerty`, `asdf`, `1q2w3e4r`), a common wordlist entry (`letmein`, `welcome`, `iloveyou`, `trustno1`, `abc123`), or a default word with a short suffix (`password123`, `p@ssw0rd`, `admin123`, `admin321`, `root1`).

## What gets flagged

```python
ADMIN_PASSWORD = "123456"
db.create_user(email="ops@example.org", password="qwerty")
SMTP_PASSWORD = os.environ.get("SMTP_PASSWORD", "abc123")
```

```javascript
cachePass: process.env.CACHE_PASSWORD || "1q2w3e4r",
```

```yaml
environment:
  - REDIS_PASSWORD=admin321
  MYSQL_PASSWORD: qwerty123
```

Not flagged: bare vendor defaults (`password`, `admin`, `changeme`, ...; VNX-1393), a weak password set for a default account (`email: admin` above `password: admin123`, `MYSQL_ROOT_PASSWORD=admin321`, `User Id=sa;Password=123456`), which is reported by VNX-1392 as a default credential pair so the line is reported once, strong or random literals, hashes, comparisons (`password === "123456"`), text inside a longer string or a comment, test code and config templates (`.env.sample`). Password-length policies are VNX-521.

## Remediation

1. Generate a long random secret per deployment and inject it from a secrets manager or the environment.
2. For seeded accounts, generate the password at install time and force a change at first login.
3. Reject wordlist passwords at sign-up (for example against a breached-password list).

## References

- [CWE-1391: Use of Weak Credentials](https://cwe.mitre.org/data/definitions/1391.html)
- [NIST SP 800-63B §5.1.1.2: Memorized secret verifiers](https://pages.nist.gov/800-63-3/sp800-63b.html)

## Suppressing this rule

Put a `nosec` comment on the line, or on line 1 to cover the whole file. Use the comment marker of the file's language (`#`, `//`, `--` or `;`):

```text
# nosec vnx-1391
// nosec vnx-1391
```

Or record an ignore rule: `vulnetix ignore add --rule vnx-1391 --reason "..."`. See [Suppressing findings](/sast/guides/suppressing-findings.md).
