VYPR
Moderate severityNVD Advisory· Published Jul 13, 2022· Updated Aug 3, 2024

CVE-2022-32065

CVE-2022-32065

Description

An arbitrary file upload vulnerability in the background management module of RuoYi v4.7.3 and below allows attackers to execute arbitrary code via a crafted HTML file.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
com.ruoyi:ruoyiMaven
< 4.7.44.7.4

Affected products

2

Patches

Vulnerability mechanics

Root cause

"Missing file-type validation in the avatar upload function allows arbitrary file uploads."

Attack vector

An attacker with access to the background management module can upload a crafted HTML file (or other executable file) as the user avatar via the `updateAvatar` endpoint. Because the original code did not validate the uploaded file's MIME type or extension, the attacker can supply a file containing arbitrary code (e.g., a JSP webshell) that, once uploaded, can be accessed and executed on the server. The patch restricts uploads to image extensions only, closing this vector [patch_id=1641467].

Affected code

The vulnerability resides in the avatar upload endpoint in `SysProfileController.java` at the `updateAvatar` method. The original code called `FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file)` without any file-type restriction, allowing arbitrary file uploads.

What the fix does

The patch adds a third argument `MimeTypeUtils.IMAGE_EXTENSION` to the `FileUploadUtils.upload()` call, which restricts uploaded avatar files to allowed image extensions (e.g., jpg, png, gif). The `InvalidExtensionException` error message was also localized to Chinese, but the key security fix is the extension whitelist. This prevents attackers from uploading non-image files such as HTML, JSP, or PHP files that could be used to execute arbitrary code on the server [patch_id=1641467][patch_id=1641468].

Preconditions

  • authAttacker must have access to the background management module of RuoYi
  • networkThe avatar upload endpoint must be reachable

Generated on May 23, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

6

News mentions

0

No linked articles in our index yet.