CVE-2025-47943: Github.com/gogs/gogs Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-xh32-cx6c-cp4v
CVSS 6.3
CWE-79
Published
Advisory Summary

CVE-2025-47943 is a MODERATE (CVSS 6.3) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Github.com/gogs/gogs libraries in the Go ecosystem. The issue involves gogs xss allowed by stored call in pdf renderer. Remediation is available by upgrading affected packages to version 0.13.3-0.20250608224432-110117b2e5e5.

CVE-2025-47943 at a Glance

CVE Identifier CVE-2025-47943
GHSA Identifier GHSA-xh32-cx6c-cp4v
Severity MODERATE
CVSS v3.1 Base Score 6.3
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Github.com/gogs/gogs
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2025-47943

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

github.com/gogs/gogs fixed: 0.13.3-0.20250608224432-110117b2e5e5
Upgrade github.com/gogs/gogs to 0.13.3-0.20250608224432-110117b2e5e5
gogs.io/gogs fixed: 0.13.3-0.20250608224432-110117b2e5e5
Upgrade gogs.io/gogs to 0.13.3-0.20250608224432-110117b2e5e5
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 github.com/gogs/gogs

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-47943, inspect your project dependencies for Github.com/gogs/gogs:

inspect dependencies for github.com/gogs/gogs

Analyze the terminal output to locate any version of Github.com/gogs/gogs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.13.3-0.20250608224432-110117b2e5e5), 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 Github.com/gogs/gogs, 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

### Summary A stored XSS is present in Gogs which allows client-side Javascript code execution. ### Details Gogs Version: ``` docker images REPOSITORY TAG IMAGE ID CREATED SIZE gogs/gogs latest fe92583bc4fe 10 hours ago 99.3MB ``` Application version: `0.14.0+dev` Local setup using: ```bash # Pull image from Docker Hub. docker pull gogs/gogs # Create local directory for volume. sudo mkdir -p /var/gogs # Use `docker run` for the first time. docker run --name=gogs -p 10022:22 -p 10880:3000 -v /var/gogs:/data gogs/gogs ``` The vulnerability is caused by the usage of a vulnerable and outdated component: `pdfjs-1.4.20` under public/plugins/. Read more about this vulnerability at [codeanlabs - CVE-2024-4367](https://codeanlabs.com/blog/research/cve-2024-4367-arbitrary-js-execution-in-pdf-js/). ### PoC 1. Upload the Proof of Concept file hosted at https://codeanlabs.com/wp-content/uploads/2024/05/poc_generalized_CVE-2024-4367.pdf in a repository. 2. Click on the file to be previewed. ![poc](https://github.com/user-attachments/assets/5af1303e-8751-49c8-af2e-d0631dd18957) ### Credits Edoardo Ottavianelli

CVE-2025-47943 Affected Github.com/gogs/gogs Versions

2 component(s)
Fixed Versions:
0.13.3-0.20250608224432-110117b2e5e5
Product / Package Ecosystem Affected Versions Fixed Version
github.com/gogs/gogs
Go
< 0.13.3-0.20250608224432-110117b2e5e5
0.13.3-0.20250608224432-110117b2e5e5
gogs.io/gogs
Go
< 0.13.3-0.20250608224432-110117b2e5e5
0.13.3-0.20250608224432-110117b2e5e5

References

Frequently Asked Questions

What is CVE-2025-47943?
CVE-2025-47943 is a security vulnerability in Github.com/gogs/gogs involving Gogs XSS allowed by stored call in PDF renderer under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Github.com/gogs/gogs versions are affected?
Affected versions include releases prior to 0.13.3-0.20250608224432-110117b2e5e5 across affected packages: github.com/gogs/gogs, gogs.io/gogs.
What version fixes CVE-2025-47943?
Upgrading to 0.13.3-0.20250608224432-110117b2e5e5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/gogs/gogs affected?
Yes, github.com/gogs/gogs is affected in releases prior to 0.13.3-0.20250608224432-110117b2e5e5. Upgrade your dependency to 0.13.3-0.20250608224432-110117b2e5e5 or later.
Is gogs.io/gogs affected?
Yes, gogs.io/gogs is affected in releases prior to 0.13.3-0.20250608224432-110117b2e5e5. Upgrade your dependency to 0.13.3-0.20250608224432-110117b2e5e5 or later.
What is the CVSS score of CVE-2025-47943?
CVE-2025-47943 has a CVSS v3.1 base score of 6.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:L/A:N.
What CWE is associated with CVE-2025-47943?
CVE-2025-47943 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 Go dependencies for CVE-2025-47943?
Run the dependency tree command: 'inspect dependencies for github.com/gogs/gogs'. 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-xh32-cx6c-cp4v",
  "modified" : "2025-07-30T17:45:37Z",
  "published" : "2025-06-26T16:54:01Z",
  "aliases" : [ "CVE-2025-47943" ],
  "summary" : "Gogs XSS allowed by stored call in PDF renderer",
  "details" : "### Summary\n\nA stored XSS is present in Gogs which allows client-side Javascript code execution.\n\n### Details\n\nGogs Version:\n```\ndocker images\nREPOSITORY   TAG       IMAGE ID       CREATED        SIZE\ngogs/gogs    latest    fe92583bc4fe   10 hours ago   99.3MB\n```\n\nApplication version: `0.14.0+dev`\n\nLocal setup using:\n```bash\n# Pull image from Docker Hub.\ndocker pull gogs/gogs\n\n# Create local directory for volume.\nsudo mkdir -p /var/gogs\n\n# Use `docker run` for the first time.\ndocker run --name=gogs -p 10022:22 -p 10880:3000 -v /var/gogs:/data gogs/gogs\n```\n\nThe vulnerability is caused by the usage of a vulnerable and outdated component: `pdfjs-1.4.20` under public/plugins/.  \nRead more about this vulnerability at [codeanlabs - CVE-2024-4367](https://codeanlabs.com/blog/research/cve-2024-4367-arbitrary-js-execution-in-pdf-js/).\n\n### PoC\n\n1. Upload the Proof of Concept file hosted at https://codeanlabs.com/wp-content/uploads/2024/05/poc_generalized_CVE-2024-4367.pdf in a repository.\n2. Click on the file to be previewed.\n\n![poc](https://github.com/user-attachments/assets/5af1303e-8751-49c8-af2e-d0631dd18957)\n\n\n### Credits\n\nEdoardo Ottavianelli",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/gogs/gogs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.13.3-0.20250608224432-110117b2e5e5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "gogs.io/gogs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.13.3-0.20250608224432-110117b2e5e5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/gogs/gogs/security/advisories/GHSA-xh32-cx6c-cp4v"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-47943"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gogs/gogs/commit/110117b2e5e5baa4809c819bec701e929d2d8d40"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gogs/gogs"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gogs/gogs/releases/tag/v0.13.3"
  }, {
    "type" : "WEB",
    "url" : "https://www.hacktivesecurity.com/blog/2025/07/15/cve-2025-47943-stored-xss-in-gogs-via-pdf"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-06-26T16:54:01Z",
    "nvd_published_at" : "2025-06-24T04:15:46Z"
  }
}