# CVE-2023-28362: Actionpack has possible cross-site scripting vulnerability via User Supplied Values to redirect_to

> Attackers can inject illegal characters into redirect headers, causing compliant downstream services to drop the Location header, potentially bypassing security controls.

- **Severity:** Medium 4.0 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 9 Jan 2025
- **Updated:** 2 May 2025
- **Also known as:** DEBIAN-CVE-2023-28362, GHSA-4g8v-vg43-wpgf, OESA-2024-2465, SUSE-SU-2023:3229-1, SUSE-SU-2023:3255-1, UBUNTU-CVE-2023-28362

## What is CVE-2023-28362?

CVE-2023-28362 is a medium-severity vulnerability in Rails Action Pack, published on 9 Jan 2025. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

The redirect_to method in Rails allows provided values to contain characters which are not legal in an HTTP header value. This results in the potential for downstream services which enforce RFC compliance on HTTP response headers to remove the assigned Location header.

Weakness: CWE-116 (Improper Encoding or Escaping of Output)

## Which versions are affected by CVE-2023-28362?

4 open source packages ship an affected version, including actionpack.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `actionpack` | RubyGems | All versions | 6.1.7.4 |
| `actionpack` | RubyGems | All versions | 6.1.7.4 |
| `actionpack` | RubyGems | From 7.0.0 | 7.0.5.1 |
| `actionpack` | RubyGems | From 7.0.0 | 7.0.5.1 |
| `rubygem-actionpack-5_1` | SUSE:Linux Enterprise High Availability Extension 15 SP1 | All versions | 5.1.4-150000.3.18.1 |
| `rubygem-actionpack-5_1` | SUSE:Linux Enterprise High Availability Extension 15 SP2 | All versions | 5.1.4-150000.3.18.1 |
| `rubygem-actionpack-5_1` | SUSE:Linux Enterprise High Availability Extension 15 SP3 | All versions | 5.1.4-150000.3.18.1 |
| `rubygem-actionpack-5_1` | SUSE:Linux Enterprise High Availability Extension 15 SP4 | All versions | 5.1.4-150000.3.18.1 |
| `rubygem-actionpack-5_1` | SUSE:Linux Enterprise High Availability Extension 15 SP5 | All versions | 5.1.4-150000.3.18.1 |
| `rubygem-actionpack-4_2` | SUSE:OpenStack Cloud Crowbar 8 | All versions | 4.2.9-7.18.1 |
| `rubygem-actionpack-4_2` | SUSE:OpenStack Cloud Crowbar 9 | All versions | 4.2.9-7.18.1 |
| `rubygem-actionpack-5_1` | openSUSE:Leap 15.4 | All versions | 5.1.4-150000.3.18.1 |
| `rubygem-actionpack-5_1` | openSUSE:Leap 15.5 | All versions | 5.1.4-150000.3.18.1 |

## How do I fix CVE-2023-28362?

Upgrade actionpack to a fixed version for your release line: 6.1.7.4 or 7.0.5.1.

## Is CVE-2023-28362 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-28362 and fix it if it is affected.

What it is: CVE-2023-28362 is a medium-severity vulnerability in Rails Action Pack, published on 9 Jan 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2023-28362 in the wild and no public exploit code.

Affected packages and fixed versions:
- actionpack (RubyGems): affected all versions; fixed in 6.1.7.4
- actionpack (RubyGems): affected all versions; fixed in 6.1.7.4
- actionpack (RubyGems): affected from 7.0.0; fixed in 7.0.5.1
- actionpack (RubyGems): affected from 7.0.0; fixed in 7.0.5.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/CVE-2023-28362/ (Markdown: https://insights.sbomify.com/CVE-2023-28362/index.md)
```

## Sources

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

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