Skip to content

GHSA-2fc2-6r4j-p65h CVE-2014-1859 PYSEC-2018-34

Numpy arbitrary file write via symlink attack

Medium PyPI
Severity
0.0 / 10
Medium · CVSS 4.0
Exploit chance (EPSS)
0.47%
Chance of exploitation in the next 30 days. Higher than 40.71% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-59 Improper Link Resolution Before File Access ('Link Following')
Fix
1.8.1
Upgrade numpy to this version or later

Description

(1) core/tests/test_memmap.py, (2) core/tests/test_multiarray.py, (3) f2py/f2py2e.py, and (4) lib/tests/test_io.py in NumPy before 1.8.1 allow local users to write to arbitrary files via a symlink attack on a temporary file.

Affected versions

PyPI

PackageVulnerableFixed in
numpy
< 1.8.1
1.8.1
numpy
< 1.8.1
1.8.1

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

numpy PyPI → 1.8.1

pip
pip install --upgrade "numpy>=1.8.1"
poetry
poetry add "numpy>=1.8.1"
uv
uv add "numpy>=1.8.1"

Severity breakdown

CVSS 4.0 0.0

CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N

Attack vector
Network
Attack complexity
Low
Attack requirements
None
Privileges required
Low
User interaction
None
Confidentiality (vulnerable system)
None
Integrity (vulnerable system)
High
Availability (vulnerable system)
None
Confidentiality (subsequent systems)
None
Integrity (subsequent systems)
None
Availability (subsequent systems)
None

CVSS 3.0 5.5

CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N

Attack vector
Local
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None

Weakness

CWE-59: Improper Link Resolution Before File Access ('Link Following')

The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.

How to prevent it
  • Architecture and Design: Follow the principle of least privilege when assigning access rights to entities in a software system. Denying access to a file can prevent an attacker from replacing that file with a link to a sensitive file. Ensure good compartmentalization in the system to provide protected areas that can be trusted.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-f7c7-j99h-c22f
Buffer Copy without Checking Size of Input in NumPy
Medium Also affects numpy
GHSA-5545-2q6w-2gh6
NumPy NULL Pointer Dereference
High Also affects numpy
GHSA-fpfv-jqm9-f5jm
Incorrect Comparison in NumPy
Medium Also affects numpy
GHSA-6p56-wp2h-9hxr
NumPy Buffer Overflow (Disputed)
Medium Also affects numpy
GHSA-9fq2-x9r6-wfmf
Numpy Deserialization of Untrusted Data
Critical Also affects numpy
GHSA-cw6w-4rcx-xphc
Arbitrary file write in NumPy
Medium Also affects numpy
GHSA-frgw-fgh6-9g52
Numpy missing input validation
High Also affects numpy
GHSA-hjqx-j4rw-g7xv
zip: Arbitrary file write outside the extraction directory, because ZipArchive::extract validates symlink targets lexically.
High Same weakness, CWE-59
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor