CVE-2022-29947: Cross-Site Scripting (XSS) in Woodpecker

Summary

30/04/2022
Yes i
Moderate
6.1

CVE-2022-29947: Woodpecker allows cross-site scripting (XSS) via build logs. Affects github.com/woodpecker-ci/woodpecker versions < 0.15.1. Fixed in 0.15.1. 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

Woodpecker is a Go-based package used for continuous integration and delivery. It provides a platform for automating build, test, and deployment processes. The package is widely used in software development workflows to streamline the development and release cycles. However, a vulnerability has been discovered in Woodpecker that allows for cross-site scripting (XSS) attacks via build logs.

Vulnerability Detail

The vulnerability (CVE-2022-29947) in Woodpecker arises from a lack of proper escaping in the 'BuildLog.vue' component. This allows an attacker to inject malicious scripts into the build logs, which can be executed when viewed by other users. The impact of this vulnerability can range from unauthorized data access to full control over user sessions, depending on the specific payload injected. The vulnerability has a CVSS score of 6.1, indicating a moderate severity level.

How To Fix

Minimum fixed version

0.15.1

This is the first release that contains the fix.

go get github.com/woodpecker-ci/woodpecker@v0.15.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users can manually sanitize the build logs to remove any potentially malicious scripts. This can be done by implementing a script sanitization function that filters out or escapes any HTML or JavaScript tags and special characters. Here is an example of a sanitization function in JavaScript:

function sanitizeLogs(logs) {
  // Remove script tags
  logs = logs.replace(/<script.*?>.*?</script>/gi, '');

  // Escape special characters
  logs = logs.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');

  return logs;
}

Conclusion

The Woodpecker package is vulnerable to cross-site scripting (XSS) attacks via build logs. It is crucial to upgrade to version 0.15.1 or later to mitigate this vulnerability. In the meantime, users can implement a temporary workaround by sanitizing the build logs to remove any potentially malicious scripts. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for github.com/woodpecker-ci/woodpecker →

Share this vulnerability

FAQ

Woodpecker is a Go-based package used for continuous integration and delivery. It automates build, test, and deployment processes in software development workflows.

Cross-site scripting (XSS) is a type of security vulnerability that allows attackers to inject malicious scripts into web pages viewed by other users. This can lead to unauthorized data access, session hijacking, and other malicious activities.

The Woodpecker vulnerability allows attackers to inject malicious scripts into build logs, which can be executed when viewed by other users. This can lead to unauthorized data access, session hijacking, and other malicious activities.

The Woodpecker vulnerability has a CVSS score of 6.1, indicating a moderate severity level.

To fix the Woodpecker vulnerability, it is recommended to upgrade to version 0.15.1 or later, which includes proper escaping of build logs in the 'BuildLog.vue' component.

Related vulnerabilities

Recent vulnerabilities recorded for github.com/woodpecker-ci/woodpecker.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

0.15.1

This is the first release that contains the fix.

go get github.com/woodpecker-ci/woodpecker@v0.15.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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