CVE-2018-18531: Insufficiently Random Values in kaptcha

com.github.penggle:kaptcha Updated 02 Oct 2025

Summary

23/10/2018
No i
Critical
9.8

CVE-2018-18531: Use of Insufficiently Random Values in penggle:kaptcha. Affects com.github.penggle:kaptcha versions < 2.3.2. 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 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

The kaptcha package is a Java library used for generating CAPTCHA images. It provides functionality for creating random text strings that can be used to verify user input. The package is commonly used in web applications to prevent automated bots from accessing sensitive areas or performing malicious actions. However, versions up to 2.3.2 of kaptcha use the insecure Random function instead of SecureRandom for generating CAPTCHA values. This makes it easier for attackers to bypass access restrictions by brute-forcing the CAPTCHA.

Vulnerability Detail

The vulnerability (CVE-2018-18531) in kaptcha arises from the use of the Random function instead of SecureRandom for generating CAPTCHA values. The Random function does not provide sufficient randomness, making it easier for attackers to guess or brute-force the CAPTCHA values. This can lead to unauthorized access to sensitive areas of web applications or the ability to perform malicious actions. The vulnerability has a CVSS score of 9.8, indicating its critical severity.

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

If updating the kaptcha package is not feasible at the moment, a possible workaround is to implement a custom solution for generating CAPTCHA values using SecureRandom. This can be done by extending the kaptcha library or implementing a separate CAPTCHA generation module. Here's an example of how to generate a random string using SecureRandom in Java:

import java.security.SecureRandom;

public class CustomCaptchaGenerator {
  public String generateCaptcha() {
    SecureRandom random = new SecureRandom();
    byte[] bytes = new byte[8];
    random.nextBytes(bytes);
    return new String(bytes);
  }
}

Conclusion

The vulnerability in kaptcha (CVE-2018-18531) arises from the use of the insecure Random function for generating CAPTCHA values. It is critical in severity with a CVSS score of 9.8. To fix this vulnerability, update the kaptcha package to version 2.3.3 or newer. If immediate updating is not possible, consider implementing a custom solution using SecureRandom. For further support on vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for com.github.penggle:kaptcha →

Share this vulnerability

FAQ

kaptcha is a Java library used for generating CAPTCHA images in web applications. It helps prevent automated bots from accessing sensitive areas or performing malicious actions.

The vulnerability (CVE-2018-18531) in kaptcha arises from the use of the insecure Random function instead of SecureRandom for generating CAPTCHA values. This makes it easier for attackers to bypass access restrictions by brute-forcing the CAPTCHA.

The vulnerability in kaptcha can lead to unauthorized access to sensitive areas of web applications or the ability to perform malicious actions. Attackers can exploit the weak randomness of CAPTCHA values to bypass access restrictions.

To fix this vulnerability, update the kaptcha package to a version that uses SecureRandom for generating CAPTCHA values. The latest version (2.3.3) addresses this issue.

If updating the kaptcha package is not feasible, you can implement a custom solution for generating CAPTCHA values using SecureRandom. See the 'workaround' section for an example.

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