Critical Vulnerability in Ruby Package: WEBrick Authentication Code Injection

ruby Updated 02 Oct 2025

Summary

19/09/2017
N/A
Yes i
High
8.8

ALPINE-CVE-2017-10784: The Basic authentication code in WEBrick library in Ruby before 2.2.8, 2.3.x before 2.3.5, and 2.4.x through 2.4.1 allows remote attackers to inject terminal emulator escape sequences into its log and possibly execute ar... Affects ruby versions < 2.4.2-r0. Fixed in 2.4.2-r0. 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 Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Ruby is a dynamic, open-source programming language with a focus on simplicity and productivity. It is widely used for web development, particularly with the Ruby on Rails framework. The WEBrick library, part of Ruby's standard library, provides HTTP server functionalities. However, it has a critical vulnerability that allows attackers to inject terminal emulator escape sequences into logs, potentially leading to arbitrary command execution.

Vulnerability Detail

The Basic authentication code in the WEBrick library in Ruby versions prior to 2.2.8, 2.3.x before 2.3.5, and 2.4.x through 2.4.1 is susceptible to an injection flaw. This vulnerability allows remote attackers to craft malicious usernames that, when logged, can execute arbitrary commands on the server. The issue arises from improper handling of user input, which fails to sanitize escape sequences, leading to severe security implications.

How To Fix

Minimum fixed version

2.4.2-r0

This is the first release that contains the fix.

sudo apk add --upgrade ruby

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

Workaround

As a temporary workaround, avoid using WEBrick for production environments until the package is updated. Consider using alternative web servers such as Puma or Unicorn that do not have this vulnerability.

Conclusion

The vulnerability in the WEBrick library of Ruby poses a significant risk due to its potential for command injection through crafted usernames. It is crucial for users to update their Ruby installations to the patched versions to mitigate this risk. Additionally, using alternative web servers can serve as a temporary measure until updates are applied.

See every vulnerability recorded for ruby →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 8.8, indicating a high severity level.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

Ruby versions before 2.2.8, 2.3.x before 2.3.5, and 2.4.x through 2.4.1 are affected by this vulnerability.

If exploited, this vulnerability could allow attackers to execute arbitrary commands on the server, leading to data breaches or server compromise.

Yes, the permanent fix is to update the Ruby package to version 2.4.2-r0 or later, which addresses the vulnerability.

Related vulnerabilities

Recent vulnerabilities recorded for ruby.

How To Fix

Minimum fixed version

2.4.2-r0

This is the first release that contains the fix.

sudo apk add --upgrade ruby

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