Vulnerabilities in pkg:maven/org.apache.nifi/nifi-single-user-utils

PACKAGE
Advisory Identifier: GHSA-rvp4-r3g6-8hxq
Advisory Summary

CVE-2022-26850 is a MODERATE (CVSS 6.5) nifi-single-user-utils vulnerability (CWE-522: Insufficiently Protected Credentials) affecting Nifi single user utils libraries in the Maven ecosystem. The issue involves nifi-single-user-utils. Remediation is available by upgrading affected packages to version 1.16.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/org.apache.nifi/nifi-single-user-utils

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/org.apache.nifi/nifi-single-user-utils. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-rvp4-r3g6-8hxq CVE-2022-26850 MODERATE Insufficiently Protected Credentials via Insecure Temporary File in org.apache.nifi:nifi-single-user-utils

CVE-2022-26850 at a Glance

CVE Identifier CVE-2022-26850
GHSA Identifier GHSA-rvp4-r3g6-8hxq
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-522: Insufficiently Protected Credentials
Affected Product Nifi single user utils
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2022-26850

To remediate this vulnerability, upgrade all affected Nifi single user utils dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.apache.nifi:nifi-single-user-utils fixed: 1.16
<dependency>
    <groupId>org.apache.nifi</groupId>
    <artifactId>nifi-single-user-utils</artifactId>
    <version>1.16</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.apache.nifi

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2022-26850, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.apache.nifi

Analyze the terminal output to locate any version of Nifi single user utils in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.16), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.apache.nifi command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-522: Insufficiently Protected Credentials, where the product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval. In Nifi single user utils, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact `org.apache.nifi.authentication.single.user.writer.StandardLoginCredentialsWriter` contains a local information disclosure vulnerability due to writing credentials (username and password) to a file that is readable by all other users on unix-like systems. On unix-like systems, the system's temporary directory is shared between all users on that system. As such, files written to that directory without setting the correct file permissions can allow other users on that system to view the contents of the files written to those temporary files. ### Source An insecure temporary file is created here: - https://github.com/apache/nifi/blob/6a1c7c72d5b91b9ce5d5cb5b86e3155d21e2c19b/nifi-commons/nifi-single-user-utils/src/main/java/org/apache/nifi/authentication/single/user/writer/StandardLoginCredentialsWriter.java#L75 The username and password credentials are written to this file here: - https://github.com/apache/nifi/blob/6a1c7c72d5b91b9ce5d5cb5b86e3155d21e2c19b/nifi-commons/nifi-single-user-utils/src/main/java/org/apache/nifi/authentication/single/user/writer/StandardLoginCredentialsWriter.java#L85-L95 ### Patches The vulnerability has been patched in version `1.16`. ### Prerequisites This vulnerability impacts Unix-like systems, and very old versions of Mac OSX and Windows as they all share the system temporary directory between all users. ### Workarounds Setting the `java.io.tmpdir` system environment variable to a directory that is exclusively owned by the executing user will fix this vulnerability for all operating systems. ### References - https://issues.apache.org/jira/browse/NIFI-9785 - https://github.com/apache/nifi/commit/859d5fe - https://github.com/apache/nifi/pull/5856 - https://nifi.apache.org/security.html#CVE-2022-26850 - https://twitter.com/JLLeitschuh/status/1511736635645435904?s=20&t=I3w3zF6Y2DUvWYsEFqERjg

CVE-2022-26850 Affected Nifi single user utils Versions

1 component(s)
Fixed Versions:
1.16
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.nifi:nifi-single-user-utils
Maven
< 1.16
1.16

References

Frequently Asked Questions

What is CVE-2022-26850?
CVE-2022-26850 is a security vulnerability in Nifi single user utils involving nifi-single-user-utils under CWE-522: Insufficiently Protected Credentials.
Which Nifi single user utils versions are affected?
Affected versions include releases prior to 1.16 across affected packages: org.apache.nifi:nifi-single-user-utils.
What version fixes CVE-2022-26850?
Upgrading to 1.16 (or the latest patched release for your respective branch) resolves the vulnerability.
Is nifi-single-user-utils affected?
Yes, org.apache.nifi:nifi-single-user-utils is affected in releases prior to 1.16. Upgrade your dependency to 1.16 or later.
What is the CVSS score of CVE-2022-26850?
CVE-2022-26850 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2022-26850?
CVE-2022-26850 is classified under CWE-522: Insufficiently Protected Credentials (The product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval.).
How can I check Maven dependencies for CVE-2022-26850?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.nifi'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-rvp4-r3g6-8hxq",
  "modified" : "2023-08-08T20:30:32Z",
  "published" : "2022-06-20T22:33:41Z",
  "aliases" : [ "CVE-2022-26850" ],
  "summary" : "Insufficiently Protected Credentials via Insecure Temporary File in org.apache.nifi:nifi-single-user-utils",
  "details" : "### Impact\n\n`org.apache.nifi.authentication.single.user.writer.StandardLoginCredentialsWriter` contains a local information disclosure vulnerability due to writing credentials (username and password) to a file that is readable by all other users on unix-like systems. On unix-like systems, the system's temporary directory is shared between all users on that system. As such, files written to that directory without setting the correct file permissions can allow other users on that system to view the contents of the files written to those temporary files.\n\n### Source\n\nAn insecure temporary file is created here:\n - https://github.com/apache/nifi/blob/6a1c7c72d5b91b9ce5d5cb5b86e3155d21e2c19b/nifi-commons/nifi-single-user-utils/src/main/java/org/apache/nifi/authentication/single/user/writer/StandardLoginCredentialsWriter.java#L75\n\nThe username and password credentials are written to this file here:\n - https://github.com/apache/nifi/blob/6a1c7c72d5b91b9ce5d5cb5b86e3155d21e2c19b/nifi-commons/nifi-single-user-utils/src/main/java/org/apache/nifi/authentication/single/user/writer/StandardLoginCredentialsWriter.java#L85-L95\n\n### Patches\n\nThe vulnerability has been patched in version `1.16`.\n\n### Prerequisites\n\nThis vulnerability impacts Unix-like systems, and very old versions of Mac OSX and Windows as they all share the system temporary directory between all users.\n\n### Workarounds\n\nSetting the `java.io.tmpdir` system environment variable to a directory that is exclusively owned by the executing user will fix this vulnerability for all operating systems.\n\n### References\n\n - https://issues.apache.org/jira/browse/NIFI-9785\n - https://github.com/apache/nifi/commit/859d5fe\n - https://github.com/apache/nifi/pull/5856\n - https://nifi.apache.org/security.html#CVE-2022-26850\n - https://twitter.com/JLLeitschuh/status/1511736635645435904?s=20&t=I3w3zF6Y2DUvWYsEFqERjg",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.nifi:nifi-single-user-utils"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.16"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.15.3"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/JLLeitschuh/security-research/security/advisories/GHSA-rvp4-r3g6-8hxq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-26850"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/nifi/commit/859d5fe"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/nifi/commit/859d5fe8cfe05ad24600b021f0ebf15753a8105c"
  }, {
    "type" : "WEB",
    "url" : "https://nifi.apache.org/security.html#CVE-2022-26850"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2022/04/06/2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-522" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-20T22:33:41Z",
    "nvd_published_at" : "2022-04-06T18:15:00Z"
  }
}