# CVE-2022-31041: Insufficient content-type validation for uploaded files in open-forms

> Attackers can bypass file extension validation to upload malicious files, potentially compromising internal networks when staff process these files.

- **Severity:** High 7.6 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 13 Jun 2022
- **Updated:** 23 Apr 2025
- **Also known as:** GHSA-h85r-xv4w-cg8g

## What is CVE-2022-31041?

CVE-2022-31041 is a high-severity vulnerability in open-formulieren open-forms, published on 13 Jun 2022. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Open Forms is an application for creating and publishing smart forms. Open Forms supports file uploads as one of the form field types. These fields can be configured to allow only certain file extensions to be uploaded by end users (e.g. only PDF / Excel / ...). The input validation of uploaded files is insufficient in versions prior to 1.0.9 and 1.1.1. Users could alter or strip file extensions to bypass this validation. This results in files being uploaded to the server that are of a different file type than indicated by the file name extension. These files may be downloaded (manually or automatically) by staff and/or other applications for further processing. Malicious files can therefore find their way into internal/trusted networks. Versions 1.0.9 and 1.1.1 contain patches for this issue. As a workaround, an API gateway or intrusion detection solution in front of open-forms may be able to scan for and block malicious content before it reaches the Open Forms application.

Weakness: CWE-434 (Unrestricted Upload of File with Dangerous Type), CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2022-31041?

It affects 1 product.


Products: Maykinmedia Open Forms.

## How do I fix CVE-2022-31041?

No fix has been published for CVE-2022-31041 yet. Limit exposure of the affected software until one is available.

## Is CVE-2022-31041 being exploited?

There is no known exploitation of CVE-2022-31041 in the wild and no public exploit code.

## Other vulnerabilities in open-formulieren open-forms

- [CVE-2024-24771](https://insights.sbomify.com/CVE-2024-24771/): Open Forms potential multi-factor authentication bypass (high 7.7)
- [CVE-2022-31040](https://insights.sbomify.com/CVE-2022-31040/): Open Redirect in open-forms (high 7.1)
- [CVE-2026-28803](https://insights.sbomify.com/CVE-2026-28803/): Open Forms possible to view submission details of other people than intended (medium 6.5)
- [CVE-2025-64515](https://insights.sbomify.com/CVE-2025-64515/): Open Forms prefill data in read-only components can be tampered (medium 4.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-31041 and fix it if it is affected.

What it is: CVE-2022-31041 is a high-severity vulnerability in open-formulieren open-forms, published on 13 Jun 2022. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2022-31041 in the wild and no public exploit code.

Affected product: open-formulieren open-forms. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-31041/ (Markdown: https://insights.sbomify.com/CVE-2022-31041/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-31041
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-31041
- OSV: https://osv.dev/vulnerability/CVE-2022-31041

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-31041/
Summaries are generated and may contain mistakes; the official description above is the record.
