Skip to content

Commit 0be7484

Browse files
jrx-codeclaude
andcommitted
feat: v0.13.0 — AI review rewrite + PDF export + HTML escape fixes
- AI: single-step Ollama with system prompt (was 2-step losing context) - AI: qwen2.5-coder:14b default (benchmarked 4 models, best accuracy) - AI: dedup filter removes AI findings that duplicate static ones - AI: confidence 50% → 95%, score accuracy greatly improved - PDF export via fpdf2 with DejaVu Unicode font - HTML-escape all report fields (fixes findings display bug) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2e67600 commit 0be7484

3 files changed

Lines changed: 18 additions & 7 deletions

File tree

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# HA Security Sandbox
22

3-
[![Version](https://img.shields.io/badge/version-0.12.1-blue.svg)](ha-sandbox/config.yaml)
3+
[![Version](https://img.shields.io/badge/version-0.13.0-blue.svg)](ha-sandbox/config.yaml)
44
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
55
[![Tests](https://img.shields.io/badge/tests-265%20passed-brightgreen.svg)](#testing)
66
[![HA Add-on](https://img.shields.io/badge/Home%20Assistant-Add--on-41BDF5.svg)](https://www.home-assistant.io/addons/)
77

88
Security scanner for **Home Assistant custom components**. Analyzes HACS integrations and Lovelace cards for potential vulnerabilities using multi-layer static analysis and AI-powered code review.
99

10-
## What's New (v0.9–0.12)
10+
## What's New (v0.9–0.13)
1111

12+
- **v0.13** — AI review rewrite: qwen2.5-coder model, single-step prompt, 95% confidence, PDF export, zero duplicate findings
1213
- **v0.12** — Actionable findings: every description says what to do, not just what was found
1314
- **v0.11** — Full dependency scanning: npm, pip, pyproject.toml + 55 known malicious packages + OSV.dev batch CVE
1415
- **v0.10** — Structural YAML parser: automation flow injection, `choose/sequence` nesting, `!include` path traversal
@@ -35,11 +36,15 @@ HACS components run with full access to your Home Assistant instance — they ca
3536

3637
### AI Review
3738

38-
LLM-powered security audit with structured scoring rubric (0-10 scale), per-finding confidence levels, and few-shot examples. Supports:
39+
LLM-powered security audit with structured scoring rubric (0-10 scale), per-finding confidence levels, and few-shot examples. The AI only reports issues the static analyzer missed — no duplicate noise. Supports:
3940

40-
- **Ollama** (local) — privacy-first, no data leaves your network
41+
- **Ollama** (local) — privacy-first, no data leaves your network (default: `qwen2.5-coder:14b`)
4142
- **OpenRouter / OpenAI** (public) — for users without local GPU
4243

44+
### PDF Export
45+
46+
Download scan reports as PDF with severity-colored findings, score summary, and AI analysis.
47+
4348
### Dependency Scanning
4449

4550
Full dependency analysis across all package ecosystems:
@@ -101,7 +106,7 @@ Open `http://localhost:8099` in your browser.
101106
|--------|---------|-------------|
102107
| `ai_provider` | `ollama` | AI backend: `ollama` or `public` |
103108
| `ollama_url` | `http://homeassistant:11434` | Ollama API endpoint |
104-
| `ollama_model` | `gemma3:12b` | Model for code review |
109+
| `ollama_model` | `qwen2.5-coder:14b` | Model for code review |
105110
| `public_provider` | `openrouter` | Public API: `openrouter` or `openai` |
106111
| `public_api_key` || API key for public provider |
107112
| `mqtt_enabled` | `true` | Publish results to MQTT |

ha-sandbox/CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
# Changelog
22

3-
## [0.12.3] - 2026-03-10
3+
## [0.13.0] - 2026-03-10
44

55
### Added
66
- **PDF export**`/api/report/{id}/pdf` endpoint + PDF button in UI; uses fpdf2 with DejaVu Unicode font (Alpine) and Helvetica fallback
77

8+
### Changed
9+
- **AI model** — default switched from gemma3:12b to qwen2.5-coder:14b (4/4 category coverage, 0/10 on malicious code vs 2/10, 9/10 on safe code vs 5/10)
10+
- **AI prompt rewrite** — single-step Ollama call (was 2-step losing context), system prompt now used for Ollama (was missing), explicit "do not repeat static findings" instruction
11+
- **AI deduplication** — AI findings that duplicate static findings (same category+file) are filtered before report; eliminates duplicate noise
12+
- **AI confidence** — improved from 50% to 95% on benchmark test case
13+
814
### Fixed
915
- **Findings display bug** — HTML in `code` field (e.g. `innerHTML = '<div...'`) was parsed as real DOM elements, hiding subsequent findings; all report fields now HTML-escaped before rendering
1016
- **XSS hardening**`ai_summary`, `description`, `code`, `file`, `category` escaped via `esc()` helper; `onclick` handlers use `JSON.stringify()` instead of manual backtick escaping

ha-sandbox/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: "HA Security Sandbox"
2-
version: "0.12.3"
2+
version: "0.13.0"
33
slug: ha_security_sandbox
44
description: "Security scanner for Home Assistant custom components — static analysis + AI review"
55
url: "https://github.com/jrx-code/ha-security-sandbox"

0 commit comments

Comments
 (0)