CVE-2022-31114: Backpack/crud Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-m8xx-3x29-84h8
CWE-79
Published
Advisory Summary

CVE-2022-31114 is a MODERATE cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Backpack/crud libraries in the Packagist ecosystem. The issue involves backpack/crud is vulnerable to cross-site scripting (xss). Remediation is available by upgrading affected packages to version 5.0.13, 4.1.69, 4.0.63.

CVE-2022-31114 at a Glance

CVE Identifier CVE-2022-31114
GHSA Identifier GHSA-m8xx-3x29-84h8
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Backpack/crud
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2022-31114

To remediate this vulnerability, upgrade all affected Backpack/crud dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

backpack/crud fixed: 5.0.13
Upgrade backpack/crud to 5.0.13
backpack/crud fixed: 4.1.69
Upgrade backpack/crud to 4.1.69
backpack/crud fixed: 4.0.63
Upgrade backpack/crud to 4.0.63
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for backpack/crud

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-31114, inspect your project dependencies for Backpack/crud:

inspect dependencies for backpack/crud

Analyze the terminal output to locate any version of Backpack/crud in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.0.13), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Backpack/crud, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact It’s a “*moderate*” vulnerability… but being an admin panel, take this seriously. It’s difficult… but an attacker could conduct a targeted phishing campaign, in order to **trick your users or admins to click a malicious link, which under very specific circumstances could give them information... or even admin access**. It’s *unlikely*, but that’s not good enough in admin panels - It should be made *impossible*. That’s why you are bothered with this. ### Patches If you don’t have custom error views, the views provided by Backpack would output the exception message *without escaping it*, which made an attack possible using Reflected XSS, in some very specific circumstances (that we will not disclose). **To fix those error views in Backpack 4.x and 5.x, please run**: ```bash composer update backpack/crud php artisan backpack:fix ``` The problem has been patched in: - v4.0.63 - v4.1.69 - v5.0.13 > **IMPORTANT! Running a `composer update` should get you the patched version, but you also need to run `php artisan backpack:fix` afterwards, to patch your published error views, if necessary.** ### Workarounds Alternatively (if you don’t want to run `composer update`), you can manually look inside your error views in “*resources/views/errors*” and output `e($exception->getMessage())` instead of `$exception->getMessage()`. That’s all there is to the fix, really. ### What the maintainers have done about this Acted as soon as our team found it (last week of March 2022): - Pushed patches to 5.x, 4.1 and 4.0; - Made it easy to apply the fix to existing projects, using a new `php artisan backpack:fix` command; - Kept the specific circumstances a secret; as far as they know, only the maintainer's team knows about the niche case where this exploit is possible; - Emailed all our licensed users, to have a chance to fix their projects before it’s public; - Sent an email blast to our 25.000+ strong Security Newsletter; - Made this public with a blog post and soon a CVE, after our community has had a reasonable chance to fix their projects; - Will continue to monitor this and remind paying users to apply this fix if they haven’t; ### For more information If you have any questions or comments about this advisory: * Open an issue in [backpack/crud](https://github.com/laravel-backpack/crud) * Email us at [hello@backpackforlaravel.com](mailto:hello@backpackforlaravel.com) --- PS. You can [read this blog post](https://backpackforlaravel.com/articles/news/we-recommend-you-fix-this-vulnerability) for more information.

CVE-2022-31114 Affected Backpack/crud Versions

3 component(s)
Fixed Versions:
5.0.134.1.694.0.63
Product / Package Ecosystem Affected Versions Fixed Version
backpack/crud
Packagist
≥ 5.0.0
< 5.0.13
5.0.13
backpack/crud
Packagist
≥ 4.1.0
< 4.1.69
4.1.69
backpack/crud
Packagist
< 4.0.63
4.0.63

References

Frequently Asked Questions

What is CVE-2022-31114?
CVE-2022-31114 is a security vulnerability in Backpack/crud involving backpack/crud is vulnerable to Cross-Site Scripting (XSS) under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Backpack/crud versions are affected?
Affected versions include releases prior to 5.0.13, 4.1.69, 4.0.63 across affected packages: backpack/crud.
What version fixes CVE-2022-31114?
Upgrading to 5.0.13, 4.1.69, 4.0.63 (or the latest patched release for your respective branch) resolves the vulnerability.
Is backpack/crud affected?
Yes, backpack/crud is affected in releases prior to 5.0.13, 4.1.69, 4.0.63. Upgrade your dependency to 5.0.13, 4.1.69, 4.0.63 or later.
What CWE is associated with CVE-2022-31114?
CVE-2022-31114 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check Packagist dependencies for CVE-2022-31114?
Run the dependency tree command: 'inspect dependencies for backpack/crud'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-m8xx-3x29-84h8",
  "modified" : "2026-06-03T20:31:29Z",
  "published" : "2026-06-03T20:25:50Z",
  "aliases" : [ "CVE-2022-31114" ],
  "summary" : "backpack/crud is vulnerable to Cross-Site Scripting (XSS)",
  "details" : "### Impact\n\nIt’s a “*moderate*” vulnerability… but being an admin panel, take this seriously. It’s difficult… but an attacker could conduct a targeted phishing campaign, in order to **trick your users or admins to click a malicious link, which under very specific circumstances could give them information... or even admin access**. It’s *unlikely*, but that’s not good enough in admin panels - It should be made *impossible*. That’s why you are bothered with this. \n\n### Patches\n\n\nIf you don’t have custom error views, the views provided by Backpack would output the exception message *without escaping it*, which made an attack possible using Reflected XSS, in some very specific circumstances (that we will not disclose). **To fix those error views in Backpack 4.x and 5.x, please run**:\n\n```bash\ncomposer update backpack/crud\nphp artisan backpack:fix\n```\n\nThe problem has been patched in:\n- v4.0.63\n- v4.1.69\n- v5.0.13\n\n> **IMPORTANT! Running a `composer update` should get you the patched version, but you also need to run `php artisan backpack:fix` afterwards, to patch your published error views, if necessary.**\n\n### Workarounds\n\nAlternatively (if you don’t want to run `composer update`), you can manually look inside your error views in “*resources/views/errors*” and output `e($exception->getMessage())` instead of `$exception->getMessage()`. That’s all there is to the fix, really.\n\n### What the maintainers have done about this\n\nActed as soon as our team found it (last week of March 2022):\n- Pushed patches to 5.x, 4.1 and 4.0;\n- Made it easy to apply the fix to existing projects, using a new `php artisan backpack:fix` command;\n- Kept the specific circumstances a secret; as far as they know, only the maintainer's team knows about the niche case where this exploit is possible;\n- Emailed all our licensed users, to have a chance to fix their projects before it’s public;\n- Sent an email blast to our 25.000+ strong Security Newsletter;\n- Made this public with a blog post and soon a CVE, after our community has had a reasonable chance to fix their projects;\n- Will continue to monitor this and remind paying users to apply this fix if they haven’t;\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Open an issue in [backpack/crud](https://github.com/laravel-backpack/crud)\n* Email us at [hello@backpackforlaravel.com](mailto:hello@backpackforlaravel.com)\n\n---\n\nPS. You can [read this blog post](https://backpackforlaravel.com/articles/news/we-recommend-you-fix-this-vulnerability) for more information.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "backpack/crud"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.0.13"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "backpack/crud"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.1.0"
      }, {
        "fixed" : "4.1.69"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "backpack/crud"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.0.63"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Laravel-Backpack/CRUD/security/advisories/GHSA-m8xx-3x29-84h8"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-31114"
  }, {
    "type" : "WEB",
    "url" : "https://backpackforlaravel.com/articles/news/we-recommend-you-fix-this-vulnerability"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Laravel-Backpack/CRUD"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-03T20:25:50Z",
    "nvd_published_at" : "2026-06-03T16:16:18Z"
  }
}