Druid vulnerability fix
How to fix the Apache Druid JavaScript sampler vulnerability. Use this skill when patching Druid code to block arbitrary JavaScript execution.From its SKILL.md
npx -y skills add cxcscmu/SkillLearnBench --skill druid-vulnerability-fixAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
1.2 KB, 203 tokens by cl100k_base, as published. Nobody here has run it
Druid JavaScript Sampler Vulnerability Fix
Overview
The vulnerability allows authenticated users to execute arbitrary code via the /druid/indexer/v1/sampler endpoint by passing a malicious JavaScript payload with an empty key "" in the JSON spec.
Fixing Strategy
- Identify the affected component: The
JavaScriptConfigor related validation logic in Druid's processing module is responsible for the JavaScript filter. - Restrict access: Ensure that the
JavaScriptfilter is properly guarded and cannot be bypassed by empty keys or other malformed JSON structures. - Validate payload: Add strict validation to the sampler configuration that prevents arbitrary code injection via the
functionproperty.
Patching Workflow
- Locate the responsible class (likely
JavaScriptFilterorJavaScriptConfig). - Implement robust input sanitization and validation.
- Generate a diff/patch file in
/root/patches/. - Apply the patch to
/root/druid/.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.