CVE-2022-3143: Wildfly-elytron Timing Attacks via Unsafe Comparator

Summary

13/01/2023
Yes i
High
7.4

CVE-2022-3143: Wildfly-elytron possibly vulnerable to timing attacks via use of unsafe comparator. Affects org.wildfly.security:wildfly-elytron across 2 version ranges.

< 1.15.15.Final >= 1.16.0.CR1, < 1.20.3.Final

Fixed in 1.15.15.Final or 1.20.3.Final, depending on the release line you run. 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 Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Wildfly-elytron is a Maven package that provides security services for the Wildfly application server. It offers authentication, authorization, and credential management functionalities. The package is widely used in Java-based enterprise applications to ensure secure communication and protect sensitive information. However, a vulnerability has been discovered in Wildfly-elytron that could potentially expose secure information or allow impersonation of authenticated users.

Vulnerability Detail

The vulnerability in Wildfly-elytron arises from its use of the java.util.Arrays.equals method, which is susceptible to timing attacks. By exploiting this flaw, an attacker can gain unauthorized access to secure information or impersonate an authenticated user. Timing attacks involve measuring the time taken to perform certain operations and using that information to infer sensitive data. To mitigate this vulnerability, it is recommended to replace the usage of java.util.Arrays.equals with the secure comparison method java.security.MessageDigest.isEqual.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 1.15.15.Final 1.15.15.Final
  • >= 1.16.0.CR1, < 1.20.3.Final 1.20.3.Final

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

If updating the package is not immediately feasible, a temporary workaround can be implemented by manually replacing instances of java.util.Arrays.equals with java.security.MessageDigest.isEqual in the affected code. Here is an example of how the replacement can be done in Java:

import java.security.MessageDigest;

// Original code using unsafe comparator
boolean isEqual = java.util.Arrays.equals(value1, value2);

// Workaround using secure comparison
MessageDigest md = MessageDigest.getInstance("SHA-256");
boolean isEqual = MessageDigest.isEqual(md.digest(value1), md.digest(value2));

It is important to note that this workaround is not a permanent solution and should be replaced with the updated package as soon as possible.

Conclusion

The vulnerability in Wildfly-elytron exposes a potential security risk by using an unsafe comparator. It is crucial to update the package to the recommended version or apply the provided workaround to mitigate the risk. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for org.wildfly.security:wildfly-elytron →

Share this vulnerability

FAQ

Wildfly-elytron is a Maven package that provides security services for the Wildfly application server. It offers authentication, authorization, and credential management functionalities.

This vulnerability in Wildfly-elytron could allow an attacker to access secure information or impersonate an authenticated user.

To fix this vulnerability, update the Wildfly-elytron package to version 1.15.15.Final or later.

Yes, a temporary workaround involves manually replacing instances of java.util.Arrays.equals with java.security.MessageDigest.isEqual in the affected code. However, updating the package is strongly recommended.

Related vulnerabilities

Recent vulnerabilities recorded for org.wildfly.security:wildfly-elytron.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 1.15.15.Final 1.15.15.Final
  • >= 1.16.0.CR1, < 1.20.3.Final 1.20.3.Final

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. 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