CVE-2022-34298
Description
The NT auth module in OpenAM before 14.6.6 allows a "replace Samba username attack."
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
org.openidentityplatform.openam:openam-coreMaven | < 14.6.6 | 14.6.6 |
Affected products
2- OpenAM/OpenAMdescription
Patches
Vulnerability mechanics
Root cause
"Missing escaping of control characters in the user-supplied password before writing it to a Samba temporary file allows newline injection."
Attack vector
An attacker can supply a password containing newline characters (`\n`, `\r\n`) or other control characters. When the NT authentication module writes this password to a temporary Samba password file, the embedded newlines break the file's line-oriented format, allowing the attacker to inject arbitrary `username = ...` lines. This effectively replaces the Samba username associated with the authentication, enabling privilege escalation or impersonation. The attack requires only the ability to submit a crafted password during NT authentication; no special network position is needed beyond normal access to the login interface.
Affected code
The vulnerability resides in `openam-authentication/openam-auth-nt/src/main/java/com/sun/identity/authentication/modules/nt/NT.java`. The `process()` method writes the `userPassword` value directly into a temporary file without escaping special characters. The password is written via `OutputStreamWriter` using the `ISO-8859-1` charset.
What the fix does
The patch introduces an `escapeSpecial()` method that uses Apache Commons Text's `AggregateTranslator` with `JAVA_CTRL_CHARS_ESCAPE` to escape control characters (e.g., `\n` becomes `\\n`, `\r` becomes `\\r`) before writing the password to the temporary file. This prevents newline injection into the Samba password file. Additionally, the `OutputStreamWriter` charset is changed from `ISO-8859-1` to `UTF-8` to properly handle non-ASCII characters. A new dependency on `commons-text` is added to the module's `pom.xml`.
Preconditions
- inputAttacker must be able to submit a password containing newline or control characters to the NT authentication module.
- configThe NT authentication module must be enabled and processing the login request.
Generated on May 23, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- github.com/advisories/GHSA-px3r-27qc-hx5gghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-34298ghsaADVISORY
- github.com/OpenIdentityPlatform/OpenAM/compare/14.6.5...14.6.6ghsax_refsource_MISCWEB
- github.com/OpenIdentityPlatform/OpenAM/pull/514ghsax_refsource_MISCWEB
- github.com/OpenIdentityPlatform/OpenAM/releases/tag/14.6.6ghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.