DE — heise online
Java: RCE with AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
Security2 min read
Security researchers at Calif found a serious flaw, called Java4Shell, in Oracle's OpenJDK. Attackers could use it to run commands on other people's computers. Oracle has released updates.
What happened
Eleven different bugs let attackers run commands on remote machines (called Remote Code Execution, or RCE). They affect Java built on Oracle's OpenJDK, version 17 and newer. Oracle released fixes on Tuesday evening. The most risky bug, Java4Shell, has a severity score of 9.2 under CVSS 4.0, a standard scale for how dangerous a flaw is. Calif later explained that only certain processors are affected. These include some Intel Xeon chips and some AMD EPYC and Ryzen chips.
Is Java memory-safe?
Java promises to be memory-safe. This means that memory errors are prevented, so programmers do not have to worry about them. But OpenJDK itself is written in C, C++ and assembly language. These languages are not memory-safe. The Java4Shell bug sits in a decoder for Base64 text. Base64 is a way to turn data into plain text characters. The OpenJDK developers wrote this decoder in assembly language, probably for speed, so it could use special AVX512 instructions on x86-64 processors.
Key facts
- The trigger is a 65-character string: 64 letters A followed by an equals sign (=).
- OpenJDK reserves 50 bytes for the output. The equals sign is handled wrongly, which gives a negative length.
- OpenJDK 17 needs twice as many A characters to trigger the bug.
- Calif says it used the bug to get remote code execution in popular Java apps, including Keycloak, Jira, Confluence, JFrog Artifactory and Jenkins. In some cases no login was needed.
Why it matters
The bug is not a finished attack yet. But researchers found real ways to use it against common apps that sit on the internet. Attackers only need to build a tailored attack for each app. No public proof-of-concept code has been released for these apps, but attackers may still build their own tools. Java4Shell attacks have not been seen in the wild so far. That could change quickly, so updates should be installed right away.
What to watch
- Whether attacks using Java4Shell appear in the wild.
- Whether attackers publish working exploits for apps such as Jira or Keycloak.
- Whether all affected Java apps get the Oracle updates in time.
Glossary
- OpenJDK
- A free, open-source version of Java, the programming language and software platform.
- Remote Code Execution
- An attack that lets someone run their own commands on a computer they do not control, over a network.
- Base64
- A method that turns data into a set of plain text characters, often used to send data in web apps.
- CVSS
- A standard scale from 0 to 10 that rates how dangerous a security flaw is.
- Keycloak
- A tool that handles logins and single sign-on for many apps.
- Jenkins
- A tool that automates building and testing software.