Druid javascript security
[COLM'26] SkillLearnBench is the first benchmark for evaluating continual learning methods that automatically generate agent skills.
npx -y skills add cxcscmu/SkillLearnBench --skill druid-javascript-securityAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
What its author says it does
Copied from the file, not written here
Specific guidance for securing JavaScript execution in Apache Druid. Use this when working with JavaScriptDimFilter, JavaScriptExtractionFn, JavaScriptAggregatorFactory, and other JS-enabled components.
SKILL.md
1.4 KB, 245 tokens by cl100k_base, as published. Nobody here has run it
Druid JavaScript Security
Core Components
The following classes are primary targets for JavaScript-based attacks:
JavaScriptDimFilterJavaScriptExtractionFnJavaScriptAggregatorFactoryJavaScriptPostAggregatorJavaScriptParseSpecJavaScriptTieredBrokerSelectorStrategyJavaScriptWorkerSelectStrategy
Hardening Pattern
- Disable Input for Config Injection: Use
@JacksonInject(useInput = OptBoolean.FALSE) JavaScriptConfig configin constructors. - Explicit Creator Mode: Use
@JsonCreator(mode = JsonCreator.Mode.PROPERTIES)to be explicit about how Jackson should treat the constructor. - Late Validation: Ensure
config.isEnabled()is checked right before script compilation or execution.
Example of a Patched Constructor
@JsonCreator
public JavaScriptDimFilter(
@JsonProperty("dimension") String dimension,
@JsonProperty("function") String function,
@JsonProperty("extractionFn") @Nullable ExtractionFn extractionFn,
@JsonProperty("filterTuning") @Nullable FilterTuning filterTuning,
@JacksonInject(useInput = OptBoolean.FALSE) JavaScriptConfig config
)