☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
Gogs logo [ WEBSITE ] [ VENDOR STATS ]
CVSS: 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H 🐛 CWE-78
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2022-2024

CVE-2022-2024 — OS Command Injection in gogs/gogs
📅 PUBLISHED: 2023-02-25 00:00 UTC 🔄 UPDATED: 2026-08-13 10:06 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: 97.84%
👁️
97.84% probability
1000×+ above the median CVE
Tier: CRITICAL
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1190
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
Country: Global License: Open Source
VULNERABLE: version not auto-detected — verify your deployed version locally
CVSS VECTOR BREAKDOWN 9.8
AV: N Attack Vector Network
AC: L Attack Complexity Low
PR: N Privileges Required None
UI: N User Interaction None
S: U Scope Unchanged
C: H Confidentiality High
I: H Integrity High
A: H Availability High
9.8
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2022-2024 is an OS Command Injection vulnerability affecting the Gogs self-hosted Git service, specifically in versions prior to 0.12.11. The vulnerability was reported by @huntrdev and carries a CVSS score of 9.8, indicating critical severity with full confidentiality, integrity, and availability impact. With an EPSS score of 0.97839 (99.9th percentile of exploited CVEs), this vulnerability is highly likely to be actively exploited in the wild, making immediate remediation a top priority for any organization running affected Gogs instances. The attack surface is the public-facing Gogs web interface, accessible to unauthenticated or low-privileged remote attackers.

Given that the patch confidence is 0/4 — meaning no patch evidence has been tracked from any official source — organizations running Gogs versions below 0.12.11 are currently exposed with no verified vendor-supplied fix available from the tracked data.

⚡ 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

Technical Analysis

CVE-2022-2024 is classified as an OS Command Injection vulnerability in the Gogs repository hosting platform. The NVD description confirms the flaw exists in versions prior to 0.12.11, and the CNA (Github) title explicitly identifies it as "OS Command Injection in gogs/gogs."

Vulnerability Mechanism: OS Command Injection occurs when an application constructs operating system commands using user-controlled input without adequate sanitization, validation, or escaping. In the context of Gogs — a self-hosted Git service written in Go — this flaw likely resides in a feature that passes user-supplied data to a system-level command execution routine. The injection point may involve functionality such as repository management hooks, webhook delivery mechanisms, or administrative CLI-adjacent operations accessible through the web interface.

Attack Surface: Gogs exposes a web-based management interface on TCP ports 80/443 (default port 3000). The application handles many different input vectors including repository names, usernames, URL parameters, and configuration settings. Any functionality that builds shell commands from these values without proper escaping represents a potential injection point.

Technical Specifics: The NVD description does not provide specific function names, file paths, or parameter details. Given the sparse description, the vulnerability class suggests the application executes external processes (e.g., git binary invocations, hook scripts) with command strings partially composed of user-controlled input. The absence of patch confidence data (0/4) further suggests the vendor may not have acknowledged or released a fix through tracked channels, though version 0.12.11 is implied as the remediation point.

The critical severity (CVSS 9.8) combined with the vulnerability class strongly suggests that exploitation requires no authentication (AV:N/AC:L/PR:N), allowing remote unauthenticated attackers to inject arbitrary OS commands. The full impact trio (C:H/I:H/A:H) indicates complete system compromise is achievable.


Exploitation Scenarios

Note: No public PoC or exploit code has been tracked for this CVE. The attack chain below is inferred from the vulnerability class (OS Command Injection) and the CVSS vector indicating unauthenticated network access.

Step 1 — Reconnaissance/Target Identification: Attackers identify Gogs instances via internet-wide scanning. Gogs instances are commonly exposed on port 3000 (default) or 80/443 behind reverse proxies. Shodan queries such as http.title:"Gogs" or product:"gogs" can rapidly enumerate vulnerable instances. The Gogs login page typically displays the version number in the page footer, allowing attackers to confirm whether the version is below 0.12.11 and therefore vulnerable.

Step 2 — Triggering the Flaw: The attacker identifies a web-accessible endpoint that accepts user-controlled input that flows into a system command execution path. For an OS Command Injection in Gogs, plausible attack vectors include repository-related operations, webhook configuration, or administrative functions. The attacker crafts a malicious request containing shell metacharacters (;, |, &&, `, $() ) appended to the expected input value.

Step 3 — Payload/Execution: At the vulnerability-class level, the attacker injects payloads such as ;whoami, |id, $(cmd), or `cmd` appended to legitimate input fields. The application constructs a command string that concatenates this input without escaping shell metacharacters, resulting in the attacker's command being executed by the underlying operating system with the privileges of the Gogs process (typically a service account, but potentially root in misconfigured deployments).

Step 4 — Post-Exploitation Impact: The injected command executes with the privileges of the Gogs service account, which — depending on deployment configuration — may have access to:

  • The Gogs configuration file containing database credentials and secret keys.
  • The Git repositories hosted on the instance (read/write access).
  • Potentially the underlying host OS through privilege escalation if the service runs with elevated privileges.
  • The ability to pivot laterally within the internal network.

Given the CVSS vector (PR:N), unauthenticated execution is possible. However, even if authentication is required for certain endpoints, the high likelihood of weak credentials on exposed Gogs instances amplifies real-world risk.


Impact Assessment

Business Impact: Gogs is a lightweight alternative to GitLab commonly used by small-to-medium businesses, development teams, and DevOps pipelines. A successful OS Command Injection compromise results in:

  • Confidentiality (High): Complete read access to all source code repositories, configuration files, database credentials, and potentially production environment secrets stored in pipeline configurations.
  • Integrity (High): Attackers can modify source code, inject backdoors into repositories, tamper with CI/CD pipelines, and alter application configuration to maintain persistent access.
  • Availability (High): The attacker can delete repositories, corrupt data, or disrupt the service entirely, stalling development operations.

Affected Systems: Any Gogs instance running version prior to 0.12.11 exposed to the network. Given the EPSS score of 0.97839, this vulnerability ranks in the 99.9th percentile of exploited CVEs, meaning exploitation activity is near-certain — the scan-to-exploit time window is likely measured in hours after a vulnerable instance is exposed.

Blast Radius: The blast radius extends from the Gogs application itself to the entire host operating system and any services reachable from that host. In containerized deployments, a compromised container can lead to container escape if misconfigured; in bare-metal or VM deployments, the compromise reaches the host OS directly. Network lateral movement is facilitated if the compromised host can reach internal systems.

CVSS Breakdown: With a CVSS score of 9.8 (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H), this is a trivial-to-exploit remote vulnerability requiring zero credentials and zero user interaction, with a declassified scope but complete impact on all three security pillars.


Detection Guidance

The following detections target the exploitation of the OS Command Injection vulnerability in Gogs.

Sigma Rule

title: Gogs OS Command Injection Attempt (CVE-2022-2024)
id: 8a7f4c2e-9b3d-4e5f-8a1b-6c9d2e3f4a5b
status: experimental
description: Detects potential OS command injection attempts against Gogs web interface
author: Valtersit Threat Intelligence
date: 2024/01/15
logsource:
    category: webserver
    product: gogs
    definition: 'Web server access logs for Gogs application'
detection:
    selection_shell_metachar:
        c-uri|contains:
            - ';ls'
            - ';cat'
            - ';id'
            - '|whoami'
            - '$(whoami)'
            - '`whoami`'
            - ';wget'
            - ';curl'
            - ';nc '
            - '&&echo'
            - '|nc '
            - ';python'
            - ';perl'
            - ';bash'
    selection_encoded:
        c-uri|contains:
            - '%3B'
            - '%7C'
            - '%24%28'
            - '%60'
            - '%26%26'
    condition: selection_shell_metachar OR selection_encoded
    falsepositives:
        - Legitimate use of special characters in repository names (unlikely)
        - Monitoring/scanning tools
    level: high
    tags:
        - attack.t1190
        - cve.2022-2024
        - cwe.78

YARA Rule

rule CVE_2022_2024_Gogs_Command_Injection
{
    meta:
        author = "Valtersit Threat Intelligence"
        description = "Detect exploitation payloads for CVE-2022-2024 in Gogs access logs and captured traffic"
        date = "2024-01-15"
        cve = "CVE-2022-2024"
        reference = "https://nvd.nist.gov/vuln/detail/CVE-2022-2024"
        severity = "critical"
    strings:
        $s1 = "/gogs" ascii nocase
        $s2 = "user/change-password" ascii nocase
        $s3 = "admin/" ascii nocase
        $s4 = "settings/" ascii nocase
        $cmd1 = ";" ascii
        $cmd2 = "|" ascii
        $cmd3 = "$(" ascii
        $cmd4 = "`" ascii
        $cmd5 = "&&" ascii
        $shell1 = "whoami" ascii nocase
        $shell2 = "id" ascii
        $shell3 = "/bin/bash" ascii nocase
        $shell4 = "/bin/sh" ascii nocase
        $shell5 = "wget" ascii nocase
        $shell6 = "curl" ascii nocase
        $shell7 = "nc" ascii
        $shell8 = "ncat" ascii nocase
        $shell9 = "python" ascii nocase
    condition:
        uint16(0) == 0x3C21 and    // HTTP request begins with HTML marker (log data) or
        any of ($s*) and
        (any of ($cmd*) or any of ($shell*)) and
        #shell* > 2
}

Suricata IDS Rule

alert http any any -> $HOME_NET any (msg:"CVE-2022-2024 - Gogs OS Command Injection Attempt"; flow:established,to_server; content:"/gogs/"; http_uri; pcre:"/[\;\|\`](\s)*(\/bin\/)?(bash|sh|python|perl)|[\;|\|\`](\s)*(\w+=\w+\s+)*\w+(\s+-[a-zA-Z]+)*(\s*[|;&])/i"; classtype:web-application-attack; sid:2022024; rev:1; reference:cve,2022-2024; reference:url,https://nvd.nist.gov/vuln/detail/CVE-2022-2024; priority:1;)

Elastic Detection

POST /_search
{
  "query": {
    "bool": {
      "filter": [
        {
          "bool": {
            "should": [
              { "match": { "url.path": "gogs" } },
              { "match": { "url.path": "user/settings" } },
              { "match": { "url.path": "repo/create" } }
            ]
          }
        },
        {
          "bool": {
            "should": [
              { "wildcard": { "url.query": "*/url_path_and_query*:*;*" } },
              { "wildcard": { "url.query": "*/url_path_and_query*:*|*" } },
              { "wildcard": { "url.query": "*/url_path_and_query*:*$(*" } },
              { "wildcard": { "url.query": "*/url_path_and_query*:*`*" } }
            ]
          }
        },
        {
          "range": {
            "@timestamp": { "gte": "now-24h" }
          }
        }
      ]
    }
  }
}

Splunk SPL Query

index=web sourcetype="access_combined" uri_path="*gogs*"
| eval cmd_injection=case(
    match(uri_query, ".*[;|\`].*(whoami|id|bash|sh|python|perl|wget|curl|nc).*"), "high_risk_shell",
    match(uri_path, ".*[;|\`].*"), "medium_risk",
    1=1, "low")
| search cmd_injection IN ("high_risk_shell", "medium_risk")
| rex field=uri_query ".*(?P<injected>[\;|\`]\s*.*)$"
| table _time, src_ip, dest_ip, uri_path, uri_query, injected, status, useragent
| sort - _time
| where cmd_injection="high_risk_shell" OR (cmd_injection="medium_risk" AND status=200)

Wazuh OSSEC Rule

<group name="web, command_execution,">
    <rule id="263673" level="12">
        <if_sid>31100</if_sid>
        <program_name>apache|nginx|gogs</program_name>
        <match>gogs|Gogs</match>
        <regex>.*[;\|\`].*(whoami|id|bash|sh|python|perl|wget|curl|nc|wget|exec).*</regex>
        <description>Possible Gogs OS Command Injection attempt (CVE-2022-2024)</description>
        <group>attack.t1190,cve-2022-2024,</group>
        <mitre>
            <id>T1190</id>
        </mitre>
    </rule>
    
    <rule id="263674" level="10">
        <if_sid>1002024</if_sid>
        <regex>%3B|%7C|%60|%24%28</regex>
        <description>Encoded shell metacharacters in Gogs request</description>
        <group>attack.t1190,cve-2022-2024,</group>
    </rule>
</group>

Mitigation & Patch Guidance

Current Patch Status: Patch confidence is 0/4 — no patch evidence from any tracked source. The NVD description references version 0.12.11 as the fixed version, but no official vendor advisory, changelog entry, or commit has been verified. This inconsistency is concerning and may indicate either an unmaintained project or inadequate vendor communication.

Immediate Mitigations (do these now):

  1. Isolate the Gogs instance immediately. Place it behind a network firewall or reverse proxy that restricts access to only legitimate internal users. If external access is required, enforce VPN or IP allowlist-only access.
  2. Disable access to the web interface during remediation if Gogs is not required for production operations — the core Git protocol (SSH/HTTP git clone/push) may continue operating, but the web UI (which is the likely attack vector) should be restricted.
  3. Review Gogs configuration for any unsafe settings that increase the attack surface, such as enabling built-in SSH, allowing user registration, or exposing the admin API.
  4. Monitor all inbound requests to the Gogs instance for shell metacharacters using the detection rules provided above.

Patch/Upgrade Steps:

  1. Check the current Gogs version via the web interface footer or git --version on the server.
  2. If running below 0.12.11, promptly upgrade to the latest stable release (0.12.11 or newer). Download the appropriate binary from the official Gogs releases repository.
  3. After upgrade, verify that no command injection vectors remain by re-scanning the application with security tools (e.g., nuclei, wpscan for Gogs-related templates).
  4. Verify patch success by confirming version numbering and testing for regression of functionality.

Long-Term Hardening:

  1. Run Gogs in a container or sandbox with minimal OS privileges. Do not run as root; use a dedicated low-privilege system account.
  2. Apply the principle of least privilege — restrict the Gogs service user's filesystem and network access. The service should only need read/write access to its repository storage and configuration directory.
  3. Enable ingress/egress network filtering — the Gogs machine should not have unnecessary outbound internet access, as this can be abused for data exfiltration post-exploitation.
  4. Implement web application firewall (WAF) rules that block shell metacharacters in HTTP requests to the Gogs endpoint.
  5. Maintain an updated vulnerability monitoring process — subscribe to Gogs release notifications and CVE alerts to ensure future vulnerabilities are patched in a timely manner.
  6. Backup configuration and repositories regularly — ensure rapid restoration capability in case of a successful breach.
  7. Audit user accounts and disable self-registration if not required, reducing the attack surface for authenticated exploitation variants.

References

  1. NVD Entry: https://nvd.nist.gov/vuln/detail/CVE-2022-2024 — Contains the official CVE description, CVSS score (9.8), and version reference (<0.12.11).
  2. Gogs Official Repository: https://github.com/gogs/gogs/releases — The official release page for verifying patched versions and obtaining updated binaries.
  3. Huntr Platform Advisory: The CVE was reported via @huntrdev, the GitHub security research platform; the advisory can be tracked at: https://huntr.com — Search for CVE-2022-2024 or the Gogs project for the original report details.
  4. FIRST EPSS Feed: https://www.first.org/epss/data_stats — Confirms the exploitation probability score of 0.97839 (99.9th percentile), indicating active exploitation.
  5. Shodan Search Reference: https://www.shodan.io/search?query=product%3A%22gogs%22 — Tool for identifying exposed Gogs instances for risk assessment.

Threat Actor Activity: While no specific threat actor campaigns have been publicly attributed to CVE-2022-2024 at the time of writing, the EPSS score of 0.97839 strongly indicates active exploitation in the wild. Given the high attack rate associated with similar Gogs/GitLab/GitHub self-hosted command injection vulnerabilities, it is reasonable to assume automated scanning and exploitation attempts are ongoing against internet-exposed instances. Security teams should treat this as actively exploited and prioritize accordingly.

👁️ SHODAN DORKS (THREAT HUNTING)

What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.

http.title:"Gogs"
product:"gogs"
http.html:"gogs" "Sign In"
◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2022-2024/ · 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.