Skip to content

com.datadog.appsec.config.MergedAsmFeatures not Initialized #9159

@andreniklasson

Description

@andreniklasson

Tracer Version(s)

1.51.0

Java Version(s)

21.0.7

JVM Vendor

Amazon Corretto

Bug Report

Hello!

We updated some of our Java services today with the latest (1.51.0) tracer agent and are suffering from NPE:s thrown here due to this.mergedAsmFeatures not being set.

The error output is:

java.lang.NullPointerException: Cannot invoke "com.datadog.appsec.config.MergedAsmFeatures.getMergedData()" because "this.mergedAsmFeatures" is null
at com.datadog.appsec.config.AppSecConfigServiceImpl.applyRemoteConfigListener(AppSecConfigServiceImpl.java:508)
at datadog.remoteconfig.DefaultConfigurationPoller.runConfigurationEndListener(DefaultConfigurationPoller.java:448)
at datadog.remoteconfig.DefaultConfigurationPoller.handleAgentResponse(DefaultConfigurationPoller.java:436)
at datadog.remoteconfig.DefaultConfigurationPoller.sendRequest(DefaultConfigurationPoller.java:343)
at datadog.remoteconfig.DefaultConfigurationPoller.poll(DefaultConfigurationPoller.java:243)
at datadog.trace.util.AgentTaskScheduler$PeriodicTask.run(AgentTaskScheduler.java:311)
at datadog.trace.util.AgentTaskScheduler$Worker.run(AgentTaskScheduler.java:266)
at java.base/java.lang.Thread.run(Thread.java:1583)

We are running the agent without any custom AppSec configuration. It seems this.mergedAsmFeatures is only initialized via init(), but applyRemoteConfigListener() can run before init() is triggered, leading to the NPE.

Expected Behavior

Ensure mergedAsmFeatures is initialized before calling applyRemoteConfigListener

Reproduction Code

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp: asm wafApplication Security Management (WAF)type: bugBug report and fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions