# GHSA-r3xc-47qg-h929: Cross-Site Scripting in @ionic/core

> Attackers can execute arbitrary JavaScript in victims' browsers via unsanitized input in specific Ionic components.

- **Severity:** Not scored
- **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 Sep 2020

## What is GHSA-r3xc-47qg-h929?

GHSA-r3xc-47qg-h929 is a cross-site scripting vulnerability in @ionic/core, published on 3 Sep 2020. 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

Versions of  `@ionic/core` prior to 4.0.3, 4.1.3, 4.2.1 or 4.3.1 are vulnerable to Cross-Site Scripting (XSS). The package uses the unsafe `innerHTML` function without sanitizing input, which may allow attackers to execute arbitrary JavaScript on the victim's browser. This issue affects the components:
- `<ion-alert>.message`
- `<ion-searchbar>.placeholder`
- `<ion-infinite-scroll-content>.loadingText`
- `<ion-refresher-content>.pullingText`
- `<ion-refresher-content>.refershingText`

## Recommendation

- If you are using @ionic/core 4.0.x, upgrade to 4.0.3 or later.
- If you are using @ionic/core 4.1.x, upgrade to 4.1.3 or later.
- If you are using @ionic/core 4.2.x, upgrade to 4.2.1 or later.
- If you are using @ionic/core 4.3.x, upgrade to 4.3.1 or later.

## Which versions are affected by GHSA-r3xc-47qg-h929?

8 open source packages ship an affected version, including @ionic/core.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@ionic/core` | npm | All versions | 4.0.3 |
| `@ionic/core` | npm | All versions | 4.0.3 |
| `@ionic/core` | npm | From 4.1.0 | 4.1.3 |
| `@ionic/core` | npm | From 4.1.0 | 4.1.3 |
| `@ionic/core` | npm | From 4.2.0 | 4.2.1 |
| `@ionic/core` | npm | From 4.2.0 | 4.2.1 |
| `@ionic/core` | npm | From 4.3.0 | 4.3.1 |
| `@ionic/core` | npm | From 4.3.0 | 4.3.1 |

## How do I fix GHSA-r3xc-47qg-h929?

Upgrade @ionic/core to a fixed version for your release line: 4.0.3, 4.1.3, 4.2.1 or 4.3.1.

## Is GHSA-r3xc-47qg-h929 being exploited?

There is no known exploitation of GHSA-r3xc-47qg-h929 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-r3xc-47qg-h929 and fix it if it is affected.

What it is: GHSA-r3xc-47qg-h929 is a cross-site scripting vulnerability in @ionic/core, published on 3 Sep 2020. 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 GHSA-r3xc-47qg-h929 in the wild and no public exploit code.

Affected packages and fixed versions:
- @ionic/core (npm): affected all versions; fixed in 4.0.3
- @ionic/core (npm): affected all versions; fixed in 4.0.3
- @ionic/core (npm): affected from 4.1.0; fixed in 4.1.3
- @ionic/core (npm): affected from 4.1.0; fixed in 4.1.3
- @ionic/core (npm): affected from 4.2.0; fixed in 4.2.1
- @ionic/core (npm): affected from 4.2.0; fixed in 4.2.1
- @ionic/core (npm): affected from 4.3.0; fixed in 4.3.1
- @ionic/core (npm): affected from 4.3.0; fixed in 4.3.1

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/GHSA-r3xc-47qg-h929/ (Markdown: https://insights.sbomify.com/GHSA-r3xc-47qg-h929/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-r3xc-47qg-h929

---
From sbomify Insights: https://insights.sbomify.com/GHSA-r3xc-47qg-h929/
Summaries are generated and may contain mistakes; the official description above is the record.
