# VNX-1390: Weak Authentication: HTTP Digest or NTLM authentication scheme

Reports code that selects a weak HTTP authentication scheme, HTTP Digest (MD5) or NTLM (MD4), in Python, JavaScript/TypeScript, Java/Kotlin.

| Field | Value |
|---|---|
| Rule ID | `VNX-1390` |
| Severity | Low |
| SARIF level | `note` |
| Kind | `sast` |
| Languages | Python, JavaScript / TypeScript, Java, Kotlin, C#, Go |
| CWE | [CWE-1390](https://cwe.mitre.org/data/definitions/1390.html) |
| CAPEC | [CAPEC-66](https://capec.mitre.org/data/definitions/66.html) |
| ATT&CK | [T1190](https://attack.mitre.org/techniques/T1190/) |
| CWSS vector | `CWSS:1.0/TI:L/AP:RU/AL:S/IC:N/FC:LT/RP:RU/RL:S/AV:L/AS:N/IN:A/SC:A/BI:L/DI:H/EX:L/EC:N/P:L` |
| Tags | `weak-authentication` `ntlm` `digest-auth` `cwe-1390` |
| Source | [`internal/sast/rules/vnx-1390.rego`](https://github.com/Vulnesis/cli/blob/main/internal/sast/rules/vnx-1390.rego) |

## Overview

VNX-1390 maps to [CWE-1390: Weak Authentication](https://cwe.mitre.org/data/definitions/1390.html). CWE-1390 is a class; the concrete form this rule sees is code that chooses HTTP Digest or NTLM authentication. Digest computes its response from MD5 over the password and NTLM from an unsalted MD4 hash, so a captured exchange can be cracked offline and NTLM can be relayed or replayed with the hash alone.

## What gets flagged

```python
requests.get(url, auth=HTTPDigestAuth(user, pw))
session_auth = HttpNtlmAuth("CORP\\svc", os.environ["SVC_PW"])
auth = HTTPDigestAuth()          # Flask-HTTPAuth server
```

```javascript
passport.use(new DigestStrategy({ qop: "auth" }, verify));
httpntlm.get({ url, username, password, domain: "CORP" }, cb);
const client = new DigestClient(user, pass);   // DigestClient = require("digest-fetch")
```

```java
p.setCredentials(AuthScope.ANY, new NTCredentials(user, pass, host, "CORP"));
val nt = NTCredentials(user, pass.toCharArray(), host, "CORP")   // Kotlin
```

```csharp
cache.Add(uri, "NTLM", cred);
listener.AuthenticationSchemes = AuthenticationSchemes.Ntlm;
```

```go
client := &http.Client{Transport: &digest.Transport{Username: u, Password: p}}   // github.com/icholy/digest
```

Not flagged: Basic, Bearer and Negotiate (Kerberos), imports and class definitions of these names, doctests, comments, strings and test code. Basic credentials over cleartext `http://` are reported by VNX-523, and plaintext password comparison by VNX-309.

## Remediation

1. Use a token scheme (OAuth 2.0 / OpenID Connect bearer tokens) or mutual TLS.
2. On Windows networks, prefer Negotiate (Kerberos) and disable NTLM fallback.
3. If Basic must be used, send it only over TLS and to a dedicated, rate-limited endpoint.

## References

- [CWE-1390: Weak Authentication](https://cwe.mitre.org/data/definitions/1390.html)
- [Microsoft: The evolution of Windows authentication (NTLM deprecation)](https://learn.microsoft.com/windows/whats-new/deprecated-features)
- [RFC 7616: HTTP Digest Access Authentication](https://www.rfc-editor.org/rfc/rfc7616)

## 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-1390
// nosec vnx-1390
```

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