Skip to main content

Gogs EUVDEUVD-2026-39084

| CVE-2026-52813 CRITICAL
Relative Path Traversal (CWE-23)
2026-06-23 https://github.com/gogs/gogs GHSA-c39w-43gm-34h5
10.0
CVSS 3.1 · Vendor: https://github.com/gogs/gogs
View

Attack ChainAIDerived

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

  1. Recon
    Self-register account on exposed Gogs
  2. Delivery
    Create outer personal repository and note its ID
  3. Exploit
    Create organization with '../../../../data/gogs/data/tmp/local-r/{ID}/nested' name
  4. Install
    Create nested repo writing into outer repo's local worktree
  5. C2
    Push commit overwriting nested .git/hooks/update with shell payload
  6. Execute
    Trigger Git operation invoking the hook
  7. Impact
    Command execution as git user

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Relative path traversal prevention
Exploitation Conditions

Requires (1) network reachability to the Gogs HTTP API, (2) an account that can create an organization and a repository - by default Gogs allows self-registration so this is effectively unauthenticated, but if an administrator has set DISABLE_REGISTRATION=true or restricted org creation, the attacker needs a low-privileged account with org-create rights, and (3) a Gogs version earlier than 0.14.3. No specific OS, database, user interaction, or non-default configuration is needed; the exploit works against the stock Docker image with PostgreSQL as shown in the PoC. The main limiting factor in practice is whether self-registration and organization creation are exposed to untrusted users.

Impact

All available signals point to a top-priority issue. The CVSS 3.1 vector AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H (10.0) is consistent with the description: the attack is performed over the normal HTTP API by a self-registered user, requires no victim interaction, and yields code execution as the git account, which trivially compromises hosted source code (scope change). A complete, reliable Python PoC is published in the GHSA advisory and a linked gist, so 'publicly available exploit code exists'. No CISA KEV entry and no EPSS score are present in the input, so widespread mass exploitation cannot be confirmed, but the combination of a public PoC, a vendor-confirmed fix, and the typical exposure profile of self-hosted Git servers on the internet means defenders should treat this as imminently exploitable. One nuance: the CVSS vector encodes PR:N, while the description notes that 'In the default setting, users can self-register'; if an operator has disabled self-registration, exploitation effectively requires PR:L (any low-privileged account that can create an organization).

Exploit ScenarioDerived

Using the published PoC (gist linked from GHSA-c39w-43gm-34h5), an attacker self-registers on an internet-exposed Gogs instance, creates a normal personal repository, then creates an organization whose name is a path-traversal string pointing at that repository's server-side local worktree (data/gogs/data/tmp/local-r/<id>/nested) and creates a nested repo inside it. From the outer repo they commit a malicious nested/<repo>.git/hooks/update script and trigger a subsequent server-side Git operation, executing arbitrary commands as the git user with access to all hosted repositories.

Act Now Prioritize within 24-48h. Why: CRITICAL severity + public POC available.
Patch available 1.1% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Jun 23, 2026

Remote code execution in Gogs self-hosted Git service before 0.14.3 allows unauthenticated attackers (where self-registration is enabled) to abuse unsanitized organization names containing '../' sequences to write Git repository files outside the intended storage root, then overwrite a repository's hooks/update script and trigger arbitrary command execution as the git user. The flaw carries a CVSS 10.0 (AV:N/AC:L/PR:N/UI:N/S:C) rating, and a fully working public proof-of-concept is published alongside the GHSA advisory, though no CISA KEV listing or EPSS data is provided in the input.

RemediationAI

Vendor-released patch: upgrade to Gogs 0.14.3 or later, which adds pathx.Clean() sanitization to repox.UserPath/RepoPath and enforces AlphaDashDot/MaxSize(35) validation on organization usernames in the API (see commit f6acd467305943aae8403cbac81f0118dd1235d7 and PR https://github.com/gogs/gogs/pull/8334, release notes at https://github.com/gogs/gogs/releases/tag/v0.14.3, advisory https://github.com/gogs/gogs/security/advisories/GHSA-c39w-43gm-34h5). If immediate upgrade is not possible, disable self-registration in app.ini ([service] DISABLE_REGISTRATION = true and REQUIRE_SIGNIN_VIEW = true) to remove the unauthenticated path (trade-off: new users must be provisioned by an admin); additionally restrict organization creation to trusted users and place the instance behind an authenticated reverse proxy or VPN. As a defense-in-depth measure, run the gogs process under a dedicated unprivileged user with no write access outside its data directory and add filesystem-level monitoring for unexpected files written to data/gogs/data/tmp/local-r/, but note that none of these workarounds fully neutralize the bug for a user who can still call the org-creation API.

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 is a lightweight self-hosted Git service written in Go (CPE pkg:go/gogs.io_gogs). The root cause is CWE-23 (Relative Path Traversal): internal/database/org.go invokes os.MkdirAll(repox.UserPath(org.Name)) and internal/repox/repox.go builds repository paths via filepath.Join(conf.Repository.Root, user) and filepath.Join(UserPath(owner), repo+'.git') without normalizing the user/org or repo name. Because filepath.Join does not strip '../' segments, an attacker-controlled org name like '../../../../data/gogs/data/tmp/local-r/{ID}/nested' resolves outside Repository.Root. The exploit pivots through the local worktree directory (data/gogs/data/tmp/local-r/<id>) that Gogs itself populates and that Git treats as writable, allowing the attacker to write a hooks/update script inside a nested bare repo and have Gogs invoke it on the next push/update.

Know when Docker 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 10.0 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
vuln.today AI 9.9 CRITICAL

Network API, low complexity, scope-changing RCE as git user; PR:L because exploitation needs an account able to create an org (self-registration default but configurable).

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

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

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

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

DescriptionCVE.org

Summary

Organization names containing path traversal sequences (../) are accepted by Gogs, and repositories under them are written to paths following these path traversals. This allows storing/retrieving data for repositories at arbitrary locations on the filesystem. By creating nested structure of Git repositories, one can overwrite the other's hooks configuration to result in Remote Code Execution (RCE).

Details

During organization creation, internal/database/org.go calls os.MkdirAll(repox.UserPath(org.Name)) without sanitizing org.Name.

https://github.com/gogs/gogs/blob/d7571322a04a29476d4241406ed50bf7eef0a5b7/internal/database/org.go#L165

Repository creation uses this name to decide where to write the Git bare repository's (org/name.git). By setting the org name to ../../../../tmp/test, and creating a repository under that organization, it gets written under /tmp/test on the server.

https://github.com/gogs/gogs/blob/d7571322a04a29476d4241406ed50bf7eef0a5b7/internal/repox/repox.go#L57-L58

An attacker can abuse this in a clever way by writing to the /data/gogs/data/tmp/local-r/1 directory, being a local worktree of the git repositories inside of Gogs. These directories are editable by Git. By creating a repository nested inside of there, files like config and hooks/update are now referenced through the path traversal, and are editable by Git. This allows the attacker to edit the hooks/update script with malicious Bash commands and then to trigger the hook.

The steps to exploit this inside of Gogs are roughly (ignoring some syncing dummy actions):

  1. Create regular outer repository and get its ID
  2. Create organization named ../../../../data/gogs/data/tmp/local-r/{ID}/nested
  3. Create a repository inside this organization (eg. rce), which will be written into the local clone of the outer repository
  4. From the outer repository, edit nested/rce.git/hooks/update to contain malicious shell commands
  5. Interact with the rce repository again to trigger the updated hook, and RCE is achieved

PoC

  1. Set up a default Gogs instance by saving the following content to docker-compose.yml and running docker compose up:
yml
services:
  db:
    image: postgres:16-alpine
    environment:
      POSTGRES_USER: gogs
      POSTGRES_PASSWORD: gogs
      POSTGRES_DB: gogs
    volumes:
      - postgres-data:/var/lib/postgresql/data
    restart: unless-stopped
    healthcheck:
      test: [ "CMD-SHELL", "pg_isready -U gogs -d gogs" ]
      interval: 5s
      timeout: 5s
      retries: 5

  gogs:
    image: gogs/gogs
    depends_on:
      db:
        condition: service_healthy
    ports:
      - "3000:3000"
    volumes:
      - gogs-data:/data
    restart: unless-stopped

volumes:
  gogs-data:
  postgres-data:
  1. Visit http://localhost:3000, set the *Host* to db:5432 and *Password* to gogs. Under *Admin Account Settings* configure your admin account
  2. As the attacker, register an account with username attacker and password attacker at http://localhost:3000/user/sign_up
  3. As the attacker, run the following script (in gist to avoid cluttering this advisory):

https://gist.github.com/JorianWoltjer/4b72063338b27140f4439c524d98f2b9

The output should look like:

shell
$ python3 gogs-rce.py
step 1 token ok
step 2 create personal repo 201 full_name attacker/writer-bd426045
step 3 web editor new file on attacker / writer-bd426045
step 4 GET writer repo -> local-r 1
step 5 create org 201 local-r 1 username ../../../../data/gogs/data/tmp/local-r/1/nested
step 6 get org 200 username ../../../../data/gogs/data/tmp/local-r/1/nested
step 7 create repo 201 full_name ../../../../data/gogs/data/tmp/local-r/1/nested/rce-b175aca7 html_url http://localhost:3000/../../../../data/gogs/data/tmp/local-r/1/nested/rce-b175aca7 clone_url http://localhost:3000/../../../../data/gogs/data/tmp/local-r/1/nested/rce-b175aca7.git
step 8 get repo 200 owner.username ../../../../data/gogs/data/tmp/local-r/1/nested full_name ../../../../data/gogs/data/tmp/local-r/1/nested/rce-b175aca7 empty False
Cloning into '/tmp/poc-writer-fy4k5064'...
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 6 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
Unpacking objects: 100% (6/6), 491 bytes | 491.00 KiB/s, done.
step 9 clone writer repo -> /tmp/poc-writer-fy4k5064
[master 3cf84b2] poc: nested/rce-b175aca7.git hook path
 1 file changed, 1 insertion(+)
 create mode 100755 nested/rce-b175aca7.git/hooks/update
step 10 write nested/rce-b175aca7.git/hooks/update with echo 'aWQ=' | base64 -d | bash > pwned
Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 14 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (6/6), 1022 bytes | 1022.00 KiB/s, done.
Total 6 (delta 0), reused 0 (delta 0), pack-reused 0
To http://localhost:3000/attacker/writer-bd426045.git
   b0b9886..3cf84b2  master -> master
step 11 push writer
step 12 API new file on attacker / writer-bd426045
step 13 API new file on org ../../../../data/gogs/data/tmp/local-r/1/nested / rce-b175aca7
step 14 API new file on attacker / writer-bd426045
step 15 GET raw pwned 200 http://localhost:3000/attacker/writer-bd426045/raw/master/nested/rce-b175aca7.git/pwned

=== COMMAND OUTPUT ===
uid=1000(git) gid=1000(git) groups=1000(git)

Impact

In the default setting, users can self-register and then create their own organizations. From here they can perform this exploit to achieve RCE as the git user.

Executive ViewAI

Why It Matters

Gogs self-hosted Git service versions before 0.14.3 contain a critical unauthenticated remote code execution vulnerability that allows attackers to execute arbitrary commands as the git user through path traversal in organization names. This directly threatens development infrastructure integrity and source code security across any organization running affected Gogs instances with self-registration enabled. With publicly available exploit code and a CVSS 10.0 score, this vulnerability demands immediate action to prevent compromise of development environments and source code repositories.

Business Impact: Severe
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
1.1%
Top 38% exploitable
Prevalence
Medium
popular self-hosted Git service, common but niche vs GitLab/Gitea
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
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 CRITICAL
CISA KEV No
Public POC Yes
EPSS 1.1%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity + public POC available
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
Out-of-Cycle
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
Very High

Priority Score

71
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +50
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

More in Docker

View all
CVE-2024-55964 CRITICAL POC
9.8 Mar 26

An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl

CVE-2019-5736 HIGH POC
8.6 Feb 11

runc through version 1.0-rc6 (used in Docker before 18.09.2) contains a container escape vulnerability that allows attac

CVE-2023-32077 HIGH POC
7.5 Aug 24

Netmaker makes networks with WireGuard. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no a

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-2023-5815 HIGH POC
8.1 Nov 22

The News & Blog Designer Pack - WordPress Blog Plugin - (Blog Post Grid, Blog Post Slider, Blog Post Carousel, Blog Post

CVE-2026-66384 MEDIUM POC
5.3 Aug 12

Path traversal in JFrog Artifactory (CWE-22) enables an authenticated low-privilege user to write data outside the inten

CVE-2014-9357 CRITICAL
10.0 Dec 16

Docker 1.3.2 allows remote attackers to execute arbitrary code with root privileges via a crafted (1) image or (2) build

CVE-2026-52806 CRITICAL POC
9.9 Jun 23

Remote code execution in Gogs through 0.14.2 allows authenticated users (and unauthenticated attackers on default-config

CVE-2025-14707 HIGH POC
8.9 Dec 15

Unauthenticated remote command injection in SGWBOX N3 firmware 2.0.25 lets attackers execute arbitrary operating-system

CVE-2026-56274 HIGH POC
8.7 Jun 23

Remote code execution in Flowise before 3.1.2 allows any authenticated user (or API caller with chatflow view/update per

CVE-2026-34156 CRITICAL POC
9.9 Mar 30

Remote code execution in NocoBase Workflow Script Node (npm @nocobase/plugin-workflow-javascript) allows authenticated l

CVE-2019-15752 HIGH POC
7.8 Aug 28

Docker Desktop Community Edition before 2.1.0.1 allows local users to gain privileges by placing a Trojan horse docker-c

Vendor StatusVendor

SUSE

Severity: Critical
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