Skip to content

Commit 1318bdf

Browse files
committed
Security fix: Disable external extension loading by default (RUN-3540)
- Changed RD_EXT_DISABLED default from false to true in Main.java - Extension directory loading now disabled by default to prevent arbitrary code execution - Users must explicitly set RD_EXT_DISABLED=false to enable external extensions - Updated CHANGELOG.md for version 2.0.10 - Added MainSpec test for Main class constants - Updated .gitignore to exclude bin/ directories Addresses security vulnerability where malicious JAR files could be loaded via RD_EXT_DIR environment variable, executing code through static initializers without user interaction.
1 parent 366d5e2 commit 1318bdf

4 files changed

Lines changed: 31 additions & 1 deletion

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
/.idea
33
/build
44
*/build
5+
/bin
6+
*/bin
57
*/out
68
*.ipr
79
*.iml

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 2.0.10
2+
3+
* **Security Fix**: External extension directory loading is now disabled by default to prevent arbitrary code execution vulnerability. To enable extension loading from external directories, set environment variable `RD_EXT_DISABLED=false`. (Addresses RUN-3540)
4+
5+
[Changes](https://github.com/rundeck/rundeck-cli/compare/v2.0.9...v2.0.10)
6+
17
## 2.0.9
28

39
* fix: NPE if system info does not return all data

rd-cli-tool/src/main/java/org/rundeck/client/tool/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ private static ConfigSource buildConfig() {
196196
}
197197

198198
private static void loadExtensionJars(ConfigSource config) {
199-
if (config.getBool(RD_EXT_DISABLED, false)) {
199+
if (config.getBool(RD_EXT_DISABLED, true)) {
200200
return;
201201
}
202202
String rd_ext_dir = config.get(RD_EXT_DIR);
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package org.rundeck.client.tool
2+
3+
import spock.lang.Specification
4+
5+
/**
6+
* Test for Main class
7+
* Note: Extension loading security behavior is tested through integration tests
8+
* and verified by the default value of RD_EXT_DISABLED in Main.java
9+
*/
10+
class MainSpec extends Specification {
11+
12+
def "RD_EXT_DISABLED constant is defined"() {
13+
expect: "RD_EXT_DISABLED constant exists"
14+
Main.RD_EXT_DISABLED == "RD_EXT_DISABLED"
15+
}
16+
17+
def "RD_EXT_DIR constant is defined"() {
18+
expect: "RD_EXT_DIR constant exists"
19+
Main.RD_EXT_DIR == "RD_EXT_DIR"
20+
}
21+
}
22+

0 commit comments

Comments
 (0)