Status

Current state: Accepted, being implemented

Discussion thread: https://lists.apache.org/thread/7qqknryoh4hxv2s7291j8g5shlcbock3

JIRA:

Released: Solr 10.x (TBD)

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast). Confluence supports inline comments that can also be used.

Motivation

Java Security Manager (JSM) was permanently removed in Java 24 (JEP 486). Solr previously relied on JSM to sandbox plugin code at runtime — restricting unauthorized file access, outbound network connections, System.exit() calls, and child process spawning. Without a replacement, Solr running on Java 24+ provides no runtime enforcement of these protections, leaving the JVM and any loaded plugin code unconstrained.

The OpenSearch project faced the same problem and solved it for OpenSearch 3.0 using a Java agent based on ByteBuddy instrumentation. See their write-up and the agent-sm source (Apache 2.0). This SIP proposes to use and adapt this approach.

Public Interfaces

The following new operator-facing interfaces are introduced:

Proposed Changes

A new Gradle subproject solr/agent-sm/ will be created, producing a standalone Java agent JAR adapted from the Apache 2.0-licensed OpenSearch libs/agent-sm. The agent uses ByteBuddy @Advice instrumentation and StackWalker (Java 9+) to intercept JDK APIs at the bytecode level — applying to all code in the JVM including plugins, without requiring any code changes. It is virtual-thread safe (no thread-identity assumptions).

Four protection categories:

The initial release will use warn-only mode — violations are logged but operations are not blocked. Operators opt into enforce mode via SOLR_SECURITY_AGENT_MODE=enforce. A future release will flip the default.

Policy files use standard JDK .policy syntax extended with Solr variable substitution (${solr.home}, ${solr.port}, ${solr.zk.port}, etc.). The operator extension file ships with commented-out examples for all known modules that require external network access (jwt-auth, extraction/Tika, opentelemetry, s3-repository, gcs-repository, cross-dc-manager).

For a detailed specification and implementation plan - generated by Github's SpecKit, see http://cominvent.com/pub/jsm-spec.html.

Compatibility, Deprecation, and Migration Plan

Security Considerations

This SIP restores runtime sandboxing for Solr on Java 24+ after JSM removal. Key points:

Test Plan

Rejected Alternatives