GHSA-pj96-4jhv-v792: Gogs.io/gogs Cross Site Scripting Vulnerability

LOW
CWE-79
Published
Advisory Summary

GHSA-pj96-4jhv-v792 is a LOW cross site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Gogs.io/gogs libraries in the Go ecosystem. The issue involves cross site scripting via cookies in gogs. Remediation is available by upgrading affected packages to version 0.12.8.

GHSA-pj96-4jhv-v792 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-pj96-4jhv-v792
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Gogs.io/gogs
Package Ecosystem Go
Published Date
Last Updated

How to Fix GHSA-pj96-4jhv-v792

To remediate this vulnerability, upgrade all affected Gogs.io/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.

gogs.io/gogs fixed: 0.12.8
Upgrade gogs.io/gogs to 0.12.8
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 gogs.io/gogs

How to Check if You Are Affected

To determine whether your application is affected by GHSA-pj96-4jhv-v792, inspect your project dependencies for Gogs.io/gogs:

inspect dependencies for gogs.io/gogs

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

### Impact There is no known practical impact other than it is just possible to manipulate CSRF cookie and XSS the malicious user self. ### Patches Invalid characters of CSRF tokens are stripped after reading cookie. Users should upgrade to 0.12.8 or the latest 0.13.0+dev. ### Workarounds No need for workarounds. ### References N/A ### For more information If you have any questions or comments about this advisory, please post on https://github.com/gogs/gogs/issues/6953.

GHSA-pj96-4jhv-v792 Affected Gogs.io/gogs Versions

1 component(s)
Fixed Versions:
0.12.8
Product / Package Ecosystem Affected Versions Fixed Version
gogs.io/gogs
Go
< 0.12.8
0.12.8

References

Frequently Asked Questions

What is GHSA-pj96-4jhv-v792?
GHSA-pj96-4jhv-v792 is a security vulnerability in Gogs.io/gogs involving Cross site scripting via cookies in gogs under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Gogs.io/gogs versions are affected?
Affected versions include releases prior to 0.12.8 across affected packages: gogs.io/gogs.
What version fixes GHSA-pj96-4jhv-v792?
Upgrading to 0.12.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is gogs.io/gogs affected?
Yes, gogs.io/gogs is affected in releases prior to 0.12.8. Upgrade your dependency to 0.12.8 or later.
What CWE is associated with GHSA-pj96-4jhv-v792?
GHSA-pj96-4jhv-v792 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 GHSA-pj96-4jhv-v792?
Run the dependency tree command: 'inspect dependencies for gogs.io/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-pj96-4jhv-v792",
  "modified" : "2022-06-02T20:46:30Z",
  "published" : "2022-06-02T20:46:30Z",
  "aliases" : [ ],
  "summary" : "Cross site scripting via cookies in gogs",
  "details" : "### Impact\n\nThere is no known practical impact other than it is just possible to manipulate CSRF cookie and XSS the malicious user self.\n\n### Patches\n\nInvalid characters of CSRF tokens are stripped after reading cookie. Users should upgrade to 0.12.8 or the latest 0.13.0+dev.\n\n### Workarounds\n\nNo need for workarounds.\n\n### References\n\nN/A\n\n### For more information\n\nIf you have any questions or comments about this advisory, please post on https://github.com/gogs/gogs/issues/6953.\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "gogs.io/gogs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.12.8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/gogs/gogs/security/advisories/GHSA-pj96-4jhv-v792"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gogs/gogs/issues/6953"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gogs/gogs"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-02T20:46:30Z",
    "nvd_published_at" : null
  }
}