CVE Vulnerabilities

CVE-2023-44387

Incorrect Permission Assignment for Critical Resource

Published: Oct 05, 2023 | Modified: Jan 21, 2024
CVSS 3.x
6.5
MEDIUM
Source:
NVD
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N
CVSS 2.x
RedHat/V2
RedHat/V3
3.2 LOW
CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:C/C:L/I:N/A:N
Ubuntu
MEDIUM

Gradle is a build tool with a focus on build automation and support for multi-language development. When copying or archiving symlinked files, Gradle resolves them but applies the permissions of the symlink itself instead of the permissions of the linked file to the resulting file. This leads to files having too much permissions given that symlinks usually are world readable and writeable. While it is unlikely this results in a direct vulnerability for the impacted build, it may open up attack vectors depending on where build artifacts end up being copied to or un-archived. In versions 7.6.3, 8.4 and above, Gradle will now properly use the permissions of the file pointed at by the symlink to set permissions of the copied or archived file.

Weakness

The product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors.

Affected Software

Name Vendor Start Version End Version
Gradle Gradle * 7.6.3 (excluding)
Gradle Gradle 8.0.0 (including) 8.4.0 (excluding)
Red Hat AMQ Streams 2.6.0 RedHat gradle *
Gradle Ubuntu bionic *
Gradle Ubuntu lunar *
Gradle Ubuntu mantic *
Gradle Ubuntu trusty *
Gradle Ubuntu xenial *

Potential Mitigations

  • Run the code in a “jail” or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which files can be accessed in a particular directory or which commands can be executed by the software.
  • OS-level examples include the Unix chroot jail, AppArmor, and SELinux. In general, managed code may provide some protection. For example, java.io.FilePermission in the Java SecurityManager allows the software to specify restrictions on file operations.
  • This may not be a feasible solution, and it only limits the impact to the operating system; the rest of the application may still be subject to compromise.
  • Be careful to avoid CWE-243 and other weaknesses related to jails.

References