CVE-2022-34190: Cross-site Scripting in Jenkins Maven Metadata Plugin

Summary

24/06/2022
No i
High
8.0

CVE-2022-34190: Cross-site Scripting in Jenkins Maven Metadata Plugin. Affects eu.markov.jenkins.plugin.mvnmeta:maven-metadata-plugin versions < 2.1. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

The Jenkins Maven Metadata Plugin is a plugin for the Jenkins CI server that provides functionality for managing Maven metadata. It allows users to view and manipulate metadata associated with Maven artifacts. The plugin is commonly used in Jenkins environments that utilize Maven for build and dependency management. However, versions 2.1 and earlier of the plugin are vulnerable to a stored cross-site scripting (XSS) attack.

Vulnerability Detail

The vulnerability in the Jenkins Maven Metadata Plugin arises from a failure to properly escape the name and description of List Maven artifact versions parameters on views displaying parameters. This allows an attacker with Item/Configure permission to inject malicious scripts into the affected pages, leading to potential XSS attacks. Exploitation of this vulnerability requires that parameters are listed on pages like 'Build With Parameters' and 'Parameters' and that those pages are not hardened to prevent exploitation. The Jenkins core has implemented measures to prevent exploitation of similar vulnerabilities on these pages since version 2.44 and LTS 2.32.2. However, the Jenkins Maven Metadata Plugin has not been updated to prevent exploitation by default.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a workaround, users can manually escape the name and description of List Maven artifact versions parameters when configuring their Jenkins jobs. This can be done by encoding any user-supplied input and ensuring that it is properly escaped before being displayed on the affected pages. Here is an example of how to encode user input in Java:

import org.apache.commons.text.StringEscapeUtils;

String userInput = ...; // User-supplied input
String escapedInput = StringEscapeUtils.escapeHtml4(userInput);

By applying this encoding to user input, the risk of XSS attacks can be mitigated.

Conclusion

The Jenkins Maven Metadata Plugin is vulnerable to a stored cross-site scripting (XSS) attack, which can be exploited by an attacker with Item/Configure permission. To mitigate this vulnerability, it is crucial to update the plugin to version 2.2 or later. Additionally, users can apply a workaround by manually escaping user input. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for eu.markov.jenkins.plugin.mvnmeta:maven-metadata-plugin →

Share this vulnerability

FAQ

The vulnerability allows an attacker with Item/Configure permission to inject malicious scripts into the affected pages, potentially leading to the execution of arbitrary code in the context of other users accessing those pages. This can result in unauthorized access to sensitive information, session hijacking, or other malicious activities.

While there are no known public exploits for this specific vulnerability at the time of this report, it is important to promptly apply the recommended fixes to mitigate the risk of exploitation.

No, this vulnerability requires an attacker to have Item/Configure permission in the Jenkins environment. Remote exploitation is not possible unless an attacker gains unauthorized access to the Jenkins server with the necessary permissions.

The Jenkins core has implemented measures to prevent exploitation of similar vulnerabilities on the 'Build With Parameters' and 'Parameters' pages since version 2.44 and LTS 2.32.2. However, the Jenkins Maven Metadata Plugin has not been updated to prevent exploitation by default. It is recommended to update the plugin to the latest version available.

Yes, a workaround is to manually escape the name and description of List Maven artifact versions parameters when configuring Jenkins jobs. This can be done by encoding user-supplied input and ensuring proper escaping before displaying it on the affected pages.

Related vulnerabilities

Recent vulnerabilities recorded for eu.markov.jenkins.plugin.mvnmeta:maven-metadata-plugin.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback