# CVE-2021-20877: Cross-site scripting in Canon laser printers and small office multifunctional printers

> Remote attackers can inject arbitrary scripts into Canon laser printers and multifunctional devices, potentially compromising user sessions or device integrity.

- **Severity:** Medium 4.8 (`CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** No
- **Published:** 8 Feb 2022
- **Updated:** 3 Aug 2024
- **Also known as:** GHSA-8g3c-f2w7-r54q

## What is CVE-2021-20877?

CVE-2021-20877 is a medium-severity cross-site scripting vulnerability in Canon laser printers and small office multifunctional printers, published on 8 Feb 2022. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.

### Official description

Cross-site scripting vulnerability in Canon laser printers and small office multifunctional printers (LBP162L/LBP162, MF4890dw, MF269dw/MF265dw/MF264dw/MF262dw, MF249dw/MF245dw/MF244dw/MF242dw/MF232w, and MF229dw/MF224dw/MF222dw sold in Japan, imageCLASS MF Series (MF113W/MF212W/MF217W/MF227DW/MF229DW, MF232W/MF244DW/MF247DW/MF249DW, MF264DW/MF267DW/MF269DW/MF269DW VP, and MF4570DN/MF4570DW/MF4770N/MF4880DW/MF4890DW) and imageCLASS LBP Series (LBP113W/LBP151DW/LBP162DW ) sold in the US, and iSENSYS (LBP162DW, LBP113W, LBP151DW, MF269dw, MF267dw, MF264dw, MF113w, MF249dw, MF247dw, MF244dw, MF237w, MF232w, MF229dw, MF217w, MF212w, MF4780w, and MF4890dw) and imageRUNNER (2206IF, 2204N, and 2204F) sold in Europe) allows remote attackers to inject an arbitrary script via unspecified vectors.

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

## Which versions are affected by CVE-2021-20877?

It affects 34 products.


Products: Canon 2204f, Canon 2204n, Canon 2206if, Canon Lbp113w, Canon Lbp151dw, Canon Lbp162, Canon Lbp162dw, Canon Lbp162l, Canon Mf113w, Canon Mf212w, Canon Mf217w, Canon Mf222dw, Canon Mf224dw, Canon Mf227dw, Canon Mf229dw, Canon Mf232w, Canon Mf237w, Canon Mf242dw, Canon Mf244dw, Canon Mf245dw and 14 more.

## How do I fix CVE-2021-20877?

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

## Is CVE-2021-20877 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-20877 and fix it if it is affected.

What it is: CVE-2021-20877 is a medium-severity cross-site scripting vulnerability in Canon laser printers and small office multifunctional printers, published on 8 Feb 2022. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2021-20877 in the wild and no public exploit code.

Affected product: Canon laser printers and small office multifunctional printers. 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-2021-20877/ (Markdown: https://insights.sbomify.com/CVE-2021-20877/index.md)
```

## Sources

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

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