Back to Intelligence

datasette-llm 0.1a10: Restricting LLM Model Access — Detection and Hardening Guide

SA
Security Arsenal Team
November 4, 2026
6 min read

On November 4, 2026, Simon Willison released datasette-llm 0.1a10, an alpha patch that fixes a critical access control flaw in the Datasette LLM plugin. The bug caused the plugin to ignore configured model restrictions, exposing all available LLM models to users instead of limiting them to an explicitly defined allowlist.

For organizations deploying Datasette as an internal data interface or public demo (like Willison's own agent.datasette.io), this misconfiguration creates immediate risks: unauthorized access to expensive or sensitive models, potential data exfiltration via unintended model capabilities, and violation of internal AI governance policies. While no CVE has been assigned, the security implications mirror classic broken access control patterns (CWE-862: Missing Authorization).

Defenders running Datasette with the LLM plugin must treat this as a configuration integrity failure. If your threat model assumes users can only access specific models (e.g., only cheap, non-sensitive models), this bug invalidated that control entirely.


Technical Analysis

Affected Products

  • datasette-llm: Versions prior to 0.1a10
  • Datasette: All versions compatible with the affected plugin
  • Deployment Context: Any instance where datasette-llm is configured with model restrictions (e.g., via datasette.yaml or environment variables)

Vulnerability Mechanism

The flaw resided in the plugin's model enumeration logic. When processing requests, datasette-llm failed to apply the configured model allowlist before presenting options to the user or executing queries. Specifically:

  1. Expected Behavior: The plugin reads configuration (e.g., plugins: datasette-llm: models: ["gpt-4", "claude-3"]) and restricts all model selection and execution to this list.
  2. Actual Behavior: The plugin enumerated and permitted access to all models registered in the LLM environment, regardless of configuration.
  3. Exploitation Requirements: An attacker or unauthorized user needed only network access to the Datasette instance. No authentication bypass was required—the system simply failed to enforce the authorization boundary it claimed to implement.

This is particularly dangerous in multi-tenant or public-facing Datasette deployments where model access correlates directly with cost (e.g., GPT-4 vs. GPT-3.5) or data sensitivity (e.g., models trained on internal documents).

Exploitation Status

  • Public Disclosure: Fixed in 0.1a10 via PR #11
  • Active Exploitation: No public reports, but trivial to exploit if discovered
  • CISA KEV: Not listed (alpha software)

Detection & Response

This is a technical threat involving access control bypass. The following detections focus on identifying unauthorized model usage and configuration drift.

SIGMA Rules

YAML
---
title: Datasette LLM Unauthorized Model Access Attempt
id: 7a3f1c82-9e4b-4d67-bc12-3e5a8f901234
status: experimental
description: Detects attempts to access LLM models not present in the configured allowlist via datasette-llm.
references:
  - https://github.com/datasette/datasette-llm/security/advisories
  - https://cwe.mitre.org/data/definitions/862.html
author: Security Arsenal
date: 2026/11/05
tags:
  - attack.privilege_escalation
  - attack.t1078
logsource:
  category: webserver
  product: linux
  service: datasette
detection:
  selection:
    cs-method: 'POST'
    cs-uri-path|contains:
      - '/-/llm'
      - '/llm'
    cs-body|contains:
      - 'model='
  filter:
    cs-body|contains:
      - 'model=gpt-4'
      - 'model=claude-3-opus'
      - 'model=default'
  condition: selection and not filter
falsepositives:
  - Legitimate administrative testing of new models before allowlist update
level: high
---
title: Datasette Configuration Modification Outside Change Window
id: 8b4e2d91-5f6a-4c8e-9d1a-2b3c4d5e6f7a
status: experimental
description: Detects modifications to datasette.yaml or environment variables outside approved change windows, potentially indicating persistence or tampering.
references:
  - https://attack.mitre.org/techniques/T1554/
author: Security Arsenal
date: 2026/11/05
tags:
  - attack.defense_evasion
  - attack.t1554
logsource:
  category: file_event
  product: linux
detection:
  selection:
    TargetFilename|endswith:
      - 'datasette.yaml'
      - 'datasette.yml'
      - '.env'
  filter:
    Image|endswith:
      - '/git'
      - '/ansible'
      - '/puppet'
  condition: selection and not filter
falsepositives:
  - Legitimate configuration updates by administrators
level: medium

KQL (Microsoft Sentinel / Defender)

Hunt for HTTP requests to Datasette LLM endpoints specifying models outside your allowlist. This query assumes you have ingested web logs into CommonSecurityLog or Syslog.

KQL — Microsoft Sentinel / Defender
// Hunt for Datasette LLM model access outside allowlist
// Update the allowed_models dynamic list to match your configuration
let allowed_models = dynamic(["gpt-4", "claude-3-opus", "default"]);
CommonSecurityLog
| where TimeGenerated > ago(24h)
| where RequestURL contains "/-/llm" or RequestURL contains "/llm"
| extend ModelParam = extract(@"model=([^&\s]+)", 1, RequestURL)
| where isnotempty(ModelParam)
| where ModelParam !in (allowed_models)
| project TimeGenerated, SourceIP, RequestURL, ModelParam, RequestMethod, UserAgent
| order by TimeGenerated desc

Velociraptor VQL

Use this artifact to hunt for unauthorized model strings in Datasette process command lines or logs on endpoints.

VQL — Velociraptor
-- Hunt for Datasette processes referencing unauthorized LLM models
SELECT Pid, Name, CommandLine, Exe, Username, CreateTime
FROM pslist()
WHERE CommandLine =~ 'datasette'
   AND CommandLine =~ 'model='
   AND NOT CommandLine =~ 'gpt-4|claude-3|default'

Remediation Script

This Bash script verifies the datasette-llm version, upgrades to 0.1a10, and validates the configuration file syntax.

Bash / Shell
#!/bin/bash
# datasette-llm 0.1a10 Security Remediation Script
# Run with sudo privileges on Datasette hosts

set -e

REQUIRED_VERSION="0.1a10"
CONFIG_FILE="/etc/datasette/datasette.yaml"

# Check if datasette-llm is installed
if ! pip3 show datasette-llm &>/dev/null; then
    echo "[-] datasette-llm not found. Nothing to patch."
    exit 0
fi

CURRENT_VERSION=$(pip3 show datasette-llm | grep Version | awk '{print $2}')
echo "[*] Current datasette-llm version: $CURRENT_VERSION"

# Upgrade to patched version
echo "[*] Upgrading to $REQUIRED_VERSION..."
pip3 install --upgrade datasette-llm==$REQUIRED_VERSION

# Verify installation
NEW_VERSION=$(pip3 show datasette-llm | grep Version | awk '{print $2}')
if [[ "$NEW_VERSION" == "$REQUIRED_VERSION" ]]; then
    echo "[+] Successfully upgraded to $NEW_VERSION"
else
    echo "[-] Upgrade failed. Current version: $NEW_VERSION"
    exit 1
fi

# Validate configuration (ensure models are explicitly listed)
if [[ -f "$CONFIG_FILE" ]]; then
    echo "[*] Validating datasette.yaml..."
    python3 -c "import yaml; yaml.safe_load(open('$CONFIG_FILE'))" && echo "[+] Config syntax OK"
    
    # Check if models are restricted
    if grep -q "models:" "$CONFIG_FILE"; then
        echo "[+] Model restrictions found in config. Verify they match your allowlist."
    else
        echo "[!] WARNING: No 'models:' key found in datasette.yaml. All models may be exposed!"
    fi
else
    echo "[!] Config file not found at $CONFIG_FILE. Manual verification required."
fi

echo "[*] Remediation complete. Restart Datasette service to apply changes."

Remediation

Immediate Actions:

  1. Upgrade: pip install --upgrade datasette-llm==0.1a10
  2. Audit Logs: Review web server and application logs for the past 30 days for requests to /-/llm with unexpected model parameters.
  3. Configuration Review: Explicitly define allowed models in datasette.yaml:
    YAML

plugins: datasette-llm: models: - gpt-4 - claude-3-opus

Code
4. **Restart Service**: Ensure the Datasette process restarts to load the patched plugin.

**Long-Term Hardening:**
- Implement **network-level ACLs** restricting access to the LLM endpoint to authorized subnets.
- Enable **authentication** for Datasette (e.g., `datasette-auth-passwords` or OAuth) even for read-only instances.
- Monitor **cost anomalies** from LLM providers—unexpected spikes may indicate unauthorized model usage.
- Treat alpha software (0.x versions) as **high-risk** for production deployments; pin versions and monitor release notes aggressively.

---

## Related Resources

[Security Arsenal Penetration Testing Services](https://securityarsenal.com/services/penetration-testing)
[AlertMonitor Platform](https://securityarsenal.com/products/alertmonitor)
[Book a SOC Assessment](https://securityarsenal.com/contact)
[vulnerability-management Intel Hub](https://securityarsenal.com/intel/incident-response)

Is your security operations ready?

Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.