Skip to content

Java 25 support: agent fails due to outdated Byte Buddy #276

@micopiira

Description

@micopiira

Bug report

Describe the bug
The Aikido Java firewall agent fails to start correctly when running on Java 25 (latest LTS) because the bundled Byte Buddy version does not recognize the JVM version. As a result, the agent cannot instrument classes.

A key issue is that the failure is silent by default. The actual error message from Byte Buddy is only logged when the environment variable AIKIDO_DEBUG=true is set. Without this flag, the instrumentation simply does not work and there is no clear indication of why the agent failed.

To Reproduce
Steps to reproduce the behavior:

  1. Use Java 25 (class file version 69).

  2. Start a Java web application (e.g., Spring MVC) with the Aikido firewall agent enabled:

    java -javaagent:<path-to-aikido-agent>.jar -jar app.jar
  3. Observe that the firewall agent does not appear to instrument the application.

  4. Restart the application with debugging enabled:

    AIKIDO_DEBUG=true java -javaagent:<path-to-aikido-agent>.jar -jar app.jar
  5. Observe the Byte Buddy error in the logs.

Expected behavior
The Aikido agent should start normally and instrument the application when running on Java 25, or at minimum clearly report that the Java version is unsupported.

Actual behavior
Instrumentation fails when running on Java 25 because the Byte Buddy dependency does not yet support it.

By default, this failure is silent. The underlying error is only visible when AIKIDO_DEBUG=true is set.

Error message (visible only with AIKIDO_DEBUG=true):

[Byte Buddy] ERROR com.sun.beans.util.Cache$CacheEntry [null, module java.desktop, Thread[#56,SpringApplicationShutdownHook,5,main], loaded=false]
java.lang.IllegalArgumentException: Java 25 (69) is not supported by the current version of Byte Buddy which officially supports Java 24 (68) - update Byte Buddy or set net.bytebuddy.experimental as a VM property

Environment

  • OS: macOS
  • Language version: Java 25
  • Framework: Spring MVC
  • Environment: local
  • Aikido Package version: latest (agent from firewall-java repository)

Additional context
The issue appears to be caused by the Byte Buddy version used by the agent not yet recognizing Java 25.

Support for Java 25 was added in Byte Buddy 1.17.5, which upgraded ASM to support Java 25 class files. Upgrading the Byte Buddy dependency in the agent to ≥ 1.17.5 should resolve the problem.

Additionally, it would be helpful if the agent surfaced this error clearly even without AIKIDO_DEBUG=true, since the current behavior makes it difficult to diagnose why the agent is not working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions