# CVE-2022-31114: backpack/crud Vulnerable to Cross-site Scripting

> An attacker can exploit cross-site scripting in the Backpack CRUD package to trick admins into clicking malicious links, potentially gaining admin access or reading sensitive information.

- **Severity:** Medium 5.1 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 3 Jun 2026
- **Updated:** 3 Jun 2026
- **Also known as:** GHSA-m8xx-3x29-84h8

## What is CVE-2022-31114?

CVE-2022-31114 is a medium-severity cross-site scripting vulnerability in Laravel-Backpack CRUD, published on 3 Jun 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

backpack/crud provides Create, Read, Update & Delete (CRUD) functions for Backpack, a collection of Laravel packages that help users build custom administration panels. Versions prior to 5.0.13, 4.1.69, and 4.0.63 are vulnerable to cross-site scripting. An attacker could conduct a targeted phishing campaign, in order to trick users or admins into clicking a malicious link, which under very specific circumstances could give them information or possibly admin access. Versions 5.0.13, 4.1.69, and 4.0.63 patch the issue. As a workaround, manually look inside error views in `resources/views/errors` and output `e($exception->getMessage())` instead of `$exception->getMessage()`.

Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation)

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

6 open source packages ship an affected version, including backpack/crud.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `backpack/crud` | Packagist | All versions | 4.0.63 |
| `backpack/crud` | Packagist | All versions | 4.0.63 |
| `backpack/crud` | Packagist | From 4.1.0 | 4.1.69 |
| `backpack/crud` | Packagist | From 4.1.0 | 4.1.69 |
| `backpack/crud` | Packagist | From 5.0.0 | 5.0.13 |
| `backpack/crud` | Packagist | From 5.0.0 | 5.0.13 |

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

Upgrade backpack/crud to a fixed version for your release line: 4.0.63, 4.1.69 or 5.0.13.

## Is CVE-2022-31114 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2022-31114 is a medium-severity cross-site scripting vulnerability in Laravel-Backpack CRUD, published on 3 Jun 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2022-31114 in the wild and no public exploit code.

Affected packages and fixed versions:
- backpack/crud (Packagist): affected all versions; fixed in 4.0.63
- backpack/crud (Packagist): affected all versions; fixed in 4.0.63
- backpack/crud (Packagist): affected from 4.1.0; fixed in 4.1.69
- backpack/crud (Packagist): affected from 4.1.0; fixed in 4.1.69
- backpack/crud (Packagist): affected from 5.0.0; fixed in 5.0.13
- backpack/crud (Packagist): affected from 5.0.0; fixed in 5.0.13

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-31114/ (Markdown: https://insights.sbomify.com/CVE-2022-31114/index.md)
```

## Sources

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

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