# CVE-2024-39311: Publify Vulnerable To Cross-Site Scripting (XSS) Via Redirects Requiring User Interaction

> A publisher can execute XSS on an administrator via malicious redirects, potentially escalating privileges to admin. Upgrade Publify to fix.

- **Severity:** Low 1.8 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:P`)
- **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:** Yes
- **Published:** 28 Mar 2025
- **Updated:** 28 Mar 2025
- **Also known as:** GHSA-8fm5-gg2f-f66q

## What is CVE-2024-39311?

CVE-2024-39311 is a low-severity cross-site scripting vulnerability in publify, published on 28 Mar 2025. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.

### Official description

Publify is a self hosted Web publishing platform on Rails. Prior to version 10.0.1 of Publify, corresponding to versions prior to 10.0.2 of the `publify_core` rubygem, publisher on a `publify` application is able to perform a cross-site scripting (XSS) attack on an administrator using the redirect functionality. The exploitation of this XSS vulnerability requires the administrator to click a malicious link. An attack could attempt to hide their payload by using HTML, or other encodings, as to not make it obvious to an administrator that this is a malicious link. A publisher may attempt to use this vulnerability to escalate their privileges and become an administrator. Version 10.0.1 of Publify and version 10.0.2 of the `publify_core` rubygem fix the issue.

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

## Which versions are affected by CVE-2024-39311?

2 open source packages ship an affected version, including publify_core. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `publify_core` | RubyGems | All versions | 10.0.2 |
| `publify_core` | RubyGems | All versions | 10.0.2 |

Products: Publify Publify, Publify Publify Core.

## How do I fix CVE-2024-39311?

Upgrade publify_core to 10.0.2 or later.

## Is CVE-2024-39311 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-39311 exists.

## Other vulnerabilities in publify

- [CVE-2014-3211](https://insights.sbomify.com/CVE-2014-3211/): Publify vulnerable to DoS attack (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-39311 and fix it if it is affected.

What it is: CVE-2024-39311 is a low-severity cross-site scripting vulnerability in publify, published on 28 Mar 2025. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-39311 exists.

Affected packages and fixed versions:
- publify_core (RubyGems): affected all versions; fixed in 10.0.2
- publify_core (RubyGems): affected all versions; fixed in 10.0.2

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

## Sources

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

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