☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
Gogs logo [ WEBSITE ] [ VENDOR STATS ]
SOON 🐛 CWE-22
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2024-44625

CVE-2024-44625 Directory Traversal in Gogs
📅 PUBLISHED: 2024-11-15 00:00 UTC 🔄 UPDATED: 2026-09-24 05:59 UTC
⏳ SCORE PENDING — ANALYSIS IN PROGRESS [ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 15.87%
👁️
15.87% probability
396.8× above the median CVE
Tier: CRITICAL
30-day exploitation window · FIRST.org · updated daily
Country: Global License: Open Source
VULNERABLE: UNKNOWN / CHECK VENDOR
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
SOON
PENDING NVD
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-44625 identifies a critical Directory Traversal vulnerability in Gogs, a self-hosted Git service, affecting versions up to and including 0.13.0. The flaw resides in the editFilePost function within internal/route/repo/editor.go, allowing an authenticated attacker to read arbitrary files from the server's filesystem by manipulating file path parameters. This can lead to unauthorized access to sensitive data, including configuration files, SSH keys, and database credentials. The vulnerability has a CVSS score of 0.0 (placeholder) but is considered high risk due to the potential for data exfiltration and lateral movement. No official patch has been released at the time of analysis.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

Gogs is a Go-based application distributed as a binary or via Docker images. The vulnerability affects the core application logic, not a third-party package. Organizations using Gogs should treat this as a critical supply chain risk, as the software is often used to manage source code and CI/CD pipelines. Compromise could lead to downstream attacks on repositories and build artifacts.

CVSS Breakdown & Threat Level

While the official CVSS vector is unknown, based on the vulnerability characteristics, a reasonable assessment is:

  • Attack Vector (AV): Network (N) – The vulnerability is exploitable over the network.
  • Attack Complexity (AC): Low (L) – No special conditions are required.
  • Privileges Required (PR): Low (L) – An authenticated user account is needed.
  • User Interaction (UI): None (N) – No user action is required beyond the attacker's own.
  • Scope (S): Unchanged (U) – The vulnerable component and the affected resource are the same.
  • Confidentiality (C): High (H) – Arbitrary file read can expose sensitive data.
  • Integrity (I): None (N) – The vulnerability does not allow file modification.
  • Availability (A): None (N) – The vulnerability does not affect availability.

Estimated CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N Estimated Base Score: 6.5 (Medium)

Threat Level: High – The vulnerability is easy to exploit and can lead to significant data exposure.

Deep Dive & Mechanics

The vulnerability exists in the editFilePost function, which handles POST requests to edit files in a repository. The function constructs a file path using user-supplied parameters without proper sanitization. By injecting path traversal sequences (e.g., ../), an attacker can escape the intended repository directory and read arbitrary files on the server.

Affected Code Location: internal/route/repo/editor.go

Root Cause: The function likely uses a string concatenation or path.Join without validating that the resulting path remains within the repository's root directory. For example:

func editFilePost(c *context.Context) {
    // ...
    treePath := c.Params(":treepath")
    // Vulnerable: treePath is used directly to construct file path
    filePath := filepath.Join(repoPath, treePath)
    // ...
}

An attacker can set :treepath to ../../../etc/passwd to read the system's password file.

Vulnerable vs. Patched Code

Vulnerable Code (Gogs <= 0.13.0):

// internal/route/repo/editor.go
func editFilePost(c *context.Context) {
    // ...
    treePath := c.Params(":treepath")
    // No sanitization - allows path traversal
    filePath := filepath.Join(repoPath, treePath)
    // ...
}

Patched Code (Hypothetical Fix):

// internal/route/repo/editor.go
func editFilePost(c *context.Context) {
    // ...
    treePath := c.Params(":treepath")
    // Sanitize: clean the path and ensure it stays within repoPath
    cleanPath := filepath.Clean(treePath)
    if strings.Contains(cleanPath, "..") {
        c.Error(400, "Invalid path")
        return
    }
    filePath := filepath.Join(repoPath, cleanPath)
    // ...
}

The fix should use filepath.Clean to resolve .. sequences and then verify the resulting path does not escape the intended base directory.

Exploitation & Lab Setup

Red Team (Exploitation)

Prerequisites:

  • A Gogs instance (<= 0.13.0) with an authenticated user account.
  • A repository where the user has write access (or any repository if the user can create one).

Exploit Steps:

  1. Authenticate to the Gogs web interface.
  2. Create or navigate to a repository.
  3. Craft a POST request to the edit file endpoint with a path traversal payload.

Example Request (using cURL):

curl -X POST \
  'http://target.gogs.com/repo/owner/repo-name/_edit/master/../../../etc/passwd' \
  -H 'Cookie: i_like_gogits=your_session_cookie' \
  -d 'content=test'

Expected Response: The server will return the contents of /etc/passwd (or an error if the file does not exist).

Alternative Payloads:

  • ../../../../etc/shadow
  • ../../../../home/gogs/.ssh/id_rsa
  • ../../../../data/gogs.db (SQLite database)

Blue Team (Detection & Response)

Detection:

  • Monitor web server logs for unusual path traversal patterns in URLs (e.g., ../, %2e%2e/).
  • Alert on POST requests to /_edit/ endpoints containing .. sequences.
  • Use WAF rules to block path traversal attempts.

Response:

  1. Isolate the affected Gogs instance.
  2. Review access logs for indicators of compromise.
  3. Rotate all secrets stored on the server (SSH keys, database passwords, API tokens).
  4. Apply the vendor patch or implement a temporary workaround (e.g., reverse proxy filtering).

Indicators of Compromise (IOCs)

Network IOCs:

  • HTTP POST requests to paths containing /_edit/ with ../ sequences.
  • Outbound connections from the Gogs server to unknown IPs (data exfiltration).

File System IOCs:

  • Unauthorized access to /etc/passwd, /etc/shadow, or other sensitive files.
  • Modified Gogs configuration files (e.g., app.ini).

Log IOCs:

  • Web server logs showing 200 responses to path traversal requests.
  • Gogs application logs with errors related to file access outside the repository.

Detection Engineering

YARA Rule

rule CVE_2024_44625_Gogs_Directory_Traversal {
    meta:
        description = "Detects path traversal attempts in Gogs editFilePost requests"
        author = "Valters IT"
        date = "2024-10-27"
        reference = "CVE-2024-44625"
    strings:
        $traversal1 = "..\\" ascii wide
        $traversal2 = "../" ascii wide
        $traversal3 = "%2e%2e/" ascii wide
        $traversal4 = "%2e%2e\\" ascii wide
        $gogs_edit = "/_edit/" ascii wide
    condition:
        $gogs_edit and any of ($traversal*)
}

Sigma Rule

title: Gogs Directory Traversal Attempt (CVE-2024-44625)
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects path traversal attempts targeting Gogs editFilePost function
author: Valters IT
date: 2024-10-27
references:
    - https://nvd.nist.gov/vuln/detail/CVE-2024-44625
logsource:
    category: webserver
    product: apache
    service: access_log
detection:
    selection:
        cs-method: 'POST'
        cs-uri-stem|contains: '/_edit/'
        cs-uri-query|contains: 
            - '..\\'
            - '../'
            - '%2e%2e/'
            - '%2e%2e\\'
    condition: selection
falsepositives:
    - Legitimate use of '..' in file names (rare)
level: high

Suricata Rule

alert http $HOME_NET any -> $EXTERNAL_NET any (
    msg:"CVE-2024-44625 Gogs Directory Traversal Attempt";
    flow:to_server,established;
    content:"POST";
    http_method;
    content:"/_edit/";
    http_uri;
    pcre:"/(?:\.\.\/|\.\.\\|%2e%2e\/|%2e%2e\\)/i";
    reference:cve,2024-44625;
    classtype:attempted-recon;
    sid:1000001;
    rev:1;
)

Remediation & Mitigation

Immediate Actions:

  1. Upgrade Gogs to a patched version (once available) or apply a vendor-supplied patch.
  2. Implement a Web Application Firewall (WAF) rule to block path traversal patterns in URLs.
  3. Restrict network access to the Gogs instance (e.g., VPN, firewall rules).

Long-Term Fixes:

  • Code Review: Ensure all file path operations use proper sanitization (e.g., filepath.Clean and path prefix checks).
  • Input Validation: Validate that user-supplied paths do not contain .. sequences.
  • Least Privilege: Run Gogs with minimal filesystem permissions to limit the impact of a successful exploit.

Workaround (if patching is not possible):

  • Use a reverse proxy (e.g., Nginx) to block requests containing ../ in the URI:
location ~ /_edit/ {
    if ($request_uri ~* "\.\.") {
        return 403;
    }
    proxy_pass http://gogs_backend;
}

Valters IT
Securing your digital frontier.

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2024-44625/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.