Skip to main content
Vulnerability Database/CVE-2025-32019

CVE-2025-32019: Harbor Cloud Registry XSS Vulnerability

CVE-2025-32019 is a cross-site scripting flaw in Harbor cloud native registry that allows attackers to inject malicious code through markdown fields. This post explains its impact, affected versions, and mitigation steps.

Published:

CVE-2025-32019 Overview

CVE-2025-32019 is a stored cross-site scripting (XSS) vulnerability in Harbor, the open source cloud native registry project that stores, signs, and scans container content. The flaw resides in the markdown field rendered by the artifact info tab page. An authenticated attacker who can edit artifact information can inject arbitrary JavaScript that executes in the browser of any user viewing the affected artifact. The issue is tracked as [CWE-79] and affects Harbor versions 2.11.2 and below, as well as 2.12.0-rc1 and 2.13.0-rc1. Harbor maintainers released fixes in versions 2.11.3 and 2.12.3.

Critical Impact

Authenticated users can inject stored XSS payloads via artifact markdown content, enabling session theft and actions in the context of other Harbor users.

Affected Products

  • Harbor versions 2.11.2 and below
  • Harbor 2.12.0-rc1
  • Harbor 2.13.0-rc1

Discovery Timeline

  • 2025-07-23 - CVE-2025-32019 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-32019

Vulnerability Analysis

Harbor renders user-supplied markdown content on the artifact info tab page of a repository. The server-side handler at src/server/v2.0/handler/repository.go returned markdown content without applying HTML-safe escaping before the frontend rendered it. An authenticated user with permission to update artifact metadata can embed HTML or JavaScript inside the markdown field. When another Harbor user opens the artifact info tab, the injected script executes in the victim's browser session.

The vulnerability requires user interaction, since a target must navigate to the affected repository or artifact page. Successful exploitation lets an attacker steal session cookies, perform API calls as the victim, or pivot to further actions inside the registry UI. Because Harbor is widely deployed as a central container registry, a compromised session for an administrator could expose image signing workflows and project configuration.

Root Cause

The root cause is improper neutralization of input during web page generation. The markdown handler trusted project-level input and emitted it into the DOM without escaping. The patch imports html/template into the repository handler to enforce HTML-safe templating when the artifact info is serialized to clients.

Attack Vector

An authenticated attacker with privileges to update artifact information submits a malicious markdown payload containing script tags or event-handler attributes. The payload is stored server-side and delivered to any user who later views the artifact info tab, executing in the context of the Harbor origin.

go
// Patch excerpt: src/server/v2.0/handler/repository.go
 import (
 	"context"
 	"fmt"
+	"html/template"
 
 	"github.com/go-openapi/runtime/middleware"

Source: GitHub Harbor Commit 76c2c5f

Detection Methods for CVE-2025-32019

Indicators of Compromise

  • Artifact or repository metadata containing <script>, javascript:, or inline event handlers such as onerror= and onload= within markdown fields.
  • Unexpected outbound requests from Harbor UI sessions to attacker-controlled domains referenced in Content Security Policy (CSP) violation reports.
  • Audit log entries showing artifact info updates from accounts that do not typically modify artifact metadata.

Detection Strategies

  • Inspect Harbor API traffic to /api/v2.0/projects/*/repositories/*/artifacts/* for PUT or PATCH requests containing HTML tags inside markdown fields.
  • Query the Harbor database for artifact info records containing script or event-handler patterns.
  • Correlate browser CSP violation reports with Harbor origins to identify active injection attempts.

Monitoring Recommendations

  • Enable Harbor audit logging and ship events to a centralized SIEM for review of artifact and repository metadata modifications.
  • Alert on anomalous session activity from administrator accounts shortly after artifact info page views.
  • Track Harbor version inventory across environments to confirm patched versions are deployed.

How to Mitigate CVE-2025-32019

Immediate Actions Required

  • Upgrade Harbor to version 2.11.3 or 2.12.3, which contain the fix for CVE-2025-32019.
  • Review existing artifact and repository markdown fields for previously injected content and sanitize or remove suspicious entries.
  • Rotate session tokens and API keys for accounts that may have viewed compromised artifact pages.

Patch Information

Harbor maintainers released fixes referenced in the GitHub Security Advisory GHSA-f9vc-vf3r-pqqq. The repository handler now imports html/template to apply HTML-safe templating. See the commits 76c2c5f, a13a163, and f019430 for the applied changes.

Workarounds

  • Restrict project membership and remove artifact update privileges from untrusted users until patching is complete.
  • Deploy a strict Content Security Policy at the reverse proxy fronting Harbor to block inline scripts.
  • Disable or avoid viewing the artifact info tab for repositories whose contributors are not fully trusted.
bash
# Verify installed Harbor version and plan upgrade
curl -sk https://harbor.example.com/api/v2.0/systeminfo | jq '.harbor_version'

# Example Helm upgrade to a patched release
helm upgrade harbor harbor/harbor --version 2.11.3 -n harbor

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.