Summary
ThingLinks versions before 1.4.0 allow authenticated users to submit Groovy scripts through the rule engine's script test and registration endpoint, where the scripts are compiled and instantiated without effective sandboxing. An attacker with valid access to this endpoint may execute arbitrary code on the server.
ThingLinks versions before 1.4.0 allow authenticated users to submit Groovy scripts through the rule engine's script test and registration endpoint, where the scripts are compiled and instantiated without effective sandboxing. An attacker with valid access to this endpoint may execute arbitrary code on the server.
Affected context
The vulnerability occurs in the ThingLinks rule engine's /groovyScriptTest/registerScript flow when user-controlled Groovy content is sent to a compilation and loading process that does not adequately restrict executable behavior. Exploitation depends on the endpoint being reachable and an attacker possessing authenticated access capable of submitting or registering script content.
The vulnerability occurs in the ThingLinks rule engine's /groovyScriptTest/registerScript flow when user-controlled Groovy content is sent to a compilation and loading process that does not adequately restrict executable behavior. Exploitation depends on the endpoint being reachable and an attacker possessing authenticated access capable of submitting or registering script content.
Exploit preconditions
- Attack surface: The ThingLinks rule engine script test and registration endpoint
- Required access: Valid authentication with permission to submit or register Groovy scripts
- Trigger point: Server-side compilation, loading, and instantiation of the submitted script
- Why exploitation is possible: User-supplied code is processed without an effective execution sandbox or sufficiently restrictive validation
- Attack surface: The ThingLinks rule engine script test and registration endpoint
- Required access: Valid authentication with permission to submit or register Groovy scripts
- Trigger point: Server-side compilation, loading, and instantiation of the submitted script
- Why exploitation is possible: User-supplied code is processed without an effective execution sandbox or sufficiently restrictive validation
Why this happens
The underlying issue is the treatment of user-controlled Groovy source as trusted executable logic. The application compiles and loads submitted script content without enforcing a narrowly defined language subset, safe execution boundary, or effective sandbox, allowing attacker-selected operations to run in the server process. This primarily maps to CWE-94, Code Injection, and may also involve CWE-78 where injected code reaches operating-system command execution.
The underlying issue is the treatment of user-controlled Groovy source as trusted executable logic. The application compiles and loads submitted script content without enforcing a narrowly defined language subset, safe execution boundary, or effective sandbox, allowing attacker-selected operations to run in the server process. This primarily maps to CWE-94, Code Injection, and may also involve CWE-78 where injected code reaches operating-system command execution.
Potential impact
- An attacker may execute arbitrary code in the ThingLinks server process.
- The compromise could expose application secrets, credentials, and IoT platform data.
- An attacker could alter rules, tamper with device-related workflows, or poison operational data.
- The server may be used to access connected systems or move laterally, depending on its privileges and network position.
- An attacker may execute arbitrary code in the ThingLinks server process.
- The compromise could expose application secrets, credentials, and IoT platform data.
- An attacker could alter rules, tamper with device-related workflows, or poison operational data.
- The server may be used to access connected systems or move laterally, depending on its privileges and network position.
General mitigation guidance
Mitigation generally centers on removing direct execution of user-supplied
source code and reducing trust in script content.
Common defensive patterns include:
- Replacing unrestricted Groovy evaluation with a constrained rule or expression language.
- Applying allowlisted syntax, APIs, classes, and operations when scripting is required.
- Executing approved logic in an isolated, least-privileged worker with restricted network and filesystem access.
- Separating script compilation from sensitive application privileges and credentials.
- Enforcing authorization, auditing, rate limits, and explicit administrative approval for script registration.
- Treating submitted scripts as untrusted even when they originate from authenticated users.
Mitigation generally centers on removing direct execution of user-supplied
source code and reducing trust in script content.
Common defensive patterns include:
- Replacing unrestricted Groovy evaluation with a constrained rule or expression language.
- Applying allowlisted syntax, APIs, classes, and operations when scripting is required.
- Executing approved logic in an isolated, least-privileged worker with restricted network and filesystem access.
- Separating script compilation from sensitive application privileges and credentials.
- Enforcing authorization, auditing, rate limits, and explicit administrative approval for script registration.
- Treating submitted scripts as untrusted even when they originate from authenticated users.
How teams detect issues like this
Organizations can look for:
- Static-analysis findings involving dynamic Groovy compilation, class loading, reflection, or evaluation of request data.
- Code-review signals where HTTP parameters or stored scripts flow into compiler, loader, interpreter, or process-execution APIs.
- Runtime logs showing unusual script registration, compilation failures, class loading, or unexpected child processes.
- Policy enforcement that blocks unrestricted scripting APIs and requires isolation for executable user content.
- Automated security review tools configured to identify CWE-94 and CWE-78 data-flow patterns.
Organizations can look for:
- Static-analysis findings involving dynamic Groovy compilation, class loading, reflection, or evaluation of request data.
- Code-review signals where HTTP parameters or stored scripts flow into compiler, loader, interpreter, or process-execution APIs.
- Runtime logs showing unusual script registration, compilation failures, class loading, or unexpected child processes.
- Policy enforcement that blocks unrestricted scripting APIs and requires isolation for executable user content.
- Automated security review tools configured to identify CWE-94 and CWE-78 data-flow patterns.

