apache-druid-security

apache-druid-security is a skill for Claude Code, Codex from cxcscmu/SkillLearnBench. It costs 28 tokens per session (892 once invoked), scanned A, original, MIT.

A security patching guide for Apache Druid, a real-time analytics database. It explains how unsafe JavaScript execution and sampler endpoints can be protected against injection and remote code execution.

In plain words
What is it for?
Use it to review and patch vulnerable Java filter, sampler, and configuration code in Apache Druid.
Why use it?
It helps prevent crafted requests from bypassing server settings and running code on the Druid server.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to review and patch vulnerable Java filter, sampler, and configuration…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cxcscmu/skilllearnbench/apache-druid-security
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add cxcscmu/SkillLearnBench --skill apache-druid-security
Clone the repo
git clone --depth 1 https://github.com/cxcscmu/SkillLearnBench

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for apache-druid-security

README.md
[![agentmods](https://agentmods.dev/badge/skills/cxcscmu/skilllearnbench/apache-druid-security.svg)](https://agentmods.dev/skills/cxcscmu/skilllearnbench/apache-druid-security)
Your own site
<a href="https://agentmods.dev/skills/cxcscmu/skilllearnbench/apache-druid-security"><img src="https://agentmods.dev/badge/skills/cxcscmu/skilllearnbench/apache-druid-security.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 892 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00028 $0.00892
Opus 5 $0.00014 $0.00446
Sonnet 5 $0.00006 $0.00178
Haiku 4.5 $0.00003 $0.00089

Measured 3d ago against content hash a6f2a2d94e93, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

apache-druid-security scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/b1-one-shot-claude-sonnet-4-6/fix-security-bug/apache-druid-security/SKILL.md · 95 lines

How it starts

The opening of the file, as written. The whole thing — 95 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Apache Druid Security Patching

Overview

Apache Druid is a real-time analytics database. Key security concern: JavaScript execution via filter/transform specs in ingestion tasks and the sampler endpoint.

CVE-2021-25646 - JavaScript Filter RCE

Vulnerability Mechanism

  • JavaScriptDimFilter uses @JacksonInject JavaScriptConfig config to get JavaScript enabled status
  • @JacksonInject with default value="" allows Jackson to fall back to JSON input when the injectable value isn't found or when useInput=OptBoolean.DEFAULT
  • Exploit: Send "": {"enabled": true} in the filter JSON to inject a permissive JavaScriptConfig
  • This bypasses the server-level druid.javascript.enabled=false setting
  • The Rhino JS engine has no ClassShutter → full Java class access → Runtime.exec() possible

Affected Files

  • processing/src/main/java/org/apache/druid/query/filter/JavaScriptDimFilter.java
  • indexing-service/src/main/java/org/apache/druid/indexing/overlord/sampler/InputSourceSampler.java
  • core/src/main/java/org/apache/druid/js/JavaScriptConfig.java

Fix 1: Block JSON Override of @JacksonInject (Root Cause)

// In JavaScriptDimFilter constructor, add useInput = OptBoolean.FALSE:
import com.fasterxml.jackson.annotation.OptBoolean;

@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  // KEY FIX
)

Fix 2: Server-Side Validation in Sampler (Defense in Depth)

// In InputSourceSampler.java - inject JavaScriptConfig via Guice:
import com.google.inject.Inject;
import org.apache.druid.js.JavaScriptConfig;
import org.apache.druid.query.filter.JavaScriptDimFilter;

public class InputSourceSampler {
    private final JavaScriptConfig javascriptConfig;

    @Inject
    public InputSourceSampler(JavaScriptConfig javascriptConfig) {
        this.javascriptConfig = javascriptConfig;
    }

    public SamplerResponse sample(...) {
        // Add BEFORE processing:
        if (!javascriptConfig.isEnabled()) {
            validateNoJavaScriptFilter(nonNullDataSchema.getTransformSpec().getFilter());
        }
    }

    private void validateNoJavaScriptFilter(@Nullable DimFilter filter) {
        if (filter instanceof JavaScriptDimFilter) {
            throw new SamplerException("JavaScript is disabled. Set druid.javascript.enabled=true to enable.");
        }
        // Also handle composite filters (AND/OR/NOT)
    }
}

Read the full file on GitHub · 95 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 95 lines · 28 tokens per session scan A a6f2a2d94e93

Subscribe to this mod's changes

apache-druid-security is a skill published in the GitHub repository cxcscmu/SkillLearnBench (83 stars, last pushed 1mo ago), licensed MIT. It adds 28 tokens to every session and 892 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

sqlite-map-parser

Parse SQLite databases into structured JSON data. Use when exploring unknown database schemas, understanding table relationships, and extracting map data as JSON.

benchflow-ai/skillsbench · 30 tokens

pubchem-database

Query PubChem via PUG-REST API/PubChemPy (110M+ compounds). Search by name/CID/SMILES, retrieve properties, similarity/substructure searches, bioactivity, for cheminformatics.

benchflow-ai/skillsbench · 49 tokens

Python скрипт для очистки CSV и подготовки к импорту в PostgreSQL

A Python script for cleaning CSV files before importing them into PostgreSQL, a database system. It handles Russian Windows-style text encoding, percentage values, data types, dates, and code lists.

ECNU-ICALK/AutoSkill · 96 tokens

Importazione XML in MS Access con mappatura dinamica dei tipi

Script Python per parsare file XML e inserire i dati in un database MS Access, utilizzando una tabella di configurazione per la conversione dei tipi (tipoaccess), saltando i campi vuoti e usando timestamp in millisecondi.

ECNU-ICALK/AutoSkill · 67 tokens

Génération SQL DDL depuis description de schéma textuel

Convertit une description textuelle structurée d'un modèle de données (entités, associations, clés étrangères, règles de fusion) en code SQL CREATE TABLE. Applique les fusions de tables spécifiées et respecte les contraintes d'intégrité référentielle.

ECNU-ICALK/AutoSkill · 66 tokens

ha-data-stores

Map of Hope Agent's local data stores and safe read-only query workflow. Use when the user asks where Hope Agent stores data, wants to inspect sessions/messages/memory/logs/background jobs/knowledge indexes/settings, asks the model to query local app data, or debugging requires checking persisted state. Trigger…

shiwenwen/hope-agent · 115 tokens