---
id: CVE-2026-49958
title: Hermes WebUI < 0.51.303 TOCTOU Race Condition via git_discard
summary: >-
  Hermes WebUI before version 0.51.303 contains a time-of-check time-of-use
  (TOCTOU) race condition vulnerability in the git_discard function within
  api/workspace_git.py that allows attackers to delete files outside the
  configured workspac…
severity: medium
cvss: 5
cvssVector: 'CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:N/I:L/A:H'
cvssSource: cna
cwe:
  - CWE-367
vendor: nesquena
product: hermes-webui
affected:
  - hermes-webui < 0.51.303
ssvc:
  exploitation: poc
  automatable: 'no'
  technicalImpact: partial
  timestamp: '2026-06-09T18:26:30.104471Z'
exploitAvailable: true
published: '2026-06-09'
updated: '2026-11-08'
sourceUpdated: '2026-11-08T14:04:59.515Z'
source: CVEORG
sourceUrl: 'https://www.cve.org/CVERecord?id=CVE-2026-49958'
references:
  - url: 'https://github.com/nesquena/hermes-webui/releases/tag/v0.51.303'
    label: hermes-webui 0.51.303 Release Notes
  - url: 'https://github.com/nesquena/hermes-webui/pull/3702'
  - url: 'https://github.com/nesquena/hermes-webui/pull/3756'
  - url: >-
      https://github.com/nesquena/hermes-webui/commit/4580f584964d640b95c4ffc9245a21ab926bec73
  - url: >-
      https://www.vulncheck.com/advisories/hermes-webui-toctou-race-condition-via-git-discard
tags:
  - cve.org
  - exploit-available
epss: 0.00081
epssPercentile: 0.00184
ingestedAt: '2026-11-08T14:51:22.381Z'
---

## Overview

Hermes WebUI before version 0.51.303 contains a time-of-check time-of-use (TOCTOU) race condition vulnerability in the git_discard function within api/workspace_git.py that allows attackers to delete files outside the configured workspace boundary by replacing a validated path component with a symlink after validation but before deletion. Attackers can substitute a workspace-controlled path component with a symlink pointing to an external directory between the safe_resolve_ws() validation step and the subsequent Path.unlink() or shutil.rmtree() deletion call, causing the delete operation to follow the symlink and remove arbitrary files outside the workspace.

## Affected

- `hermes-webui < 0.51.303`

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
