From 930ec9eb80ed108399905e3fe54937c4fe9843a5 Mon Sep 17 00:00:00 2001 From: AlexanderWhitestone <8633216+AlexanderWhitestone@users.noreply.github.com> Date: Thu, 26 Feb 2026 02:07:54 -0500 Subject: [PATCH] Security: Fix XSS vulnerabilities in dashboard templates and improve mobile test UI safety --- .../20260226_070455_add_docstring.md | 19 +++++ .../20260226_070455_break_it.md | 31 +++++++++ .../20260226_070455_do_something_vague.md | 12 ++++ .../20260226_070455_fix_foo.md | 31 +++++++++ ...fix_foo_important_correction_from_previ.md | 34 +++++++++ src/dashboard/templates/mobile_test.html | 44 +++++++++--- .../templates/partials/agent_chat_msg.html | 6 +- .../templates/partials/agent_panel.html | 10 +-- .../partials/swarm_agents_sidebar.html | 4 +- tests/test_security_fixes_xss.py | 69 +++++++++++++++++++ 10 files changed, 241 insertions(+), 19 deletions(-) create mode 100644 data/self_modify_reports/20260226_070455_add_docstring.md create mode 100644 data/self_modify_reports/20260226_070455_break_it.md create mode 100644 data/self_modify_reports/20260226_070455_do_something_vague.md create mode 100644 data/self_modify_reports/20260226_070455_fix_foo.md create mode 100644 data/self_modify_reports/20260226_070455_fix_foo_important_correction_from_previ.md create mode 100644 tests/test_security_fixes_xss.py diff --git a/data/self_modify_reports/20260226_070455_add_docstring.md b/data/self_modify_reports/20260226_070455_add_docstring.md new file mode 100644 index 00000000..3eee61a7 --- /dev/null +++ b/data/self_modify_reports/20260226_070455_add_docstring.md @@ -0,0 +1,19 @@ +# Self-Modify Report: 20260226_070455 + +**Instruction:** Add docstring +**Target files:** src/foo.py +**Dry run:** True +**Backend:** ollama +**Branch:** N/A +**Result:** SUCCESS +**Error:** none +**Commit:** none +**Attempts:** 1 +**Autonomous cycles:** 0 + +## Attempt 1 -- dry_run + +### LLM Response +``` +llm raw +``` diff --git a/data/self_modify_reports/20260226_070455_break_it.md b/data/self_modify_reports/20260226_070455_break_it.md new file mode 100644 index 00000000..be08013c --- /dev/null +++ b/data/self_modify_reports/20260226_070455_break_it.md @@ -0,0 +1,31 @@ +# Self-Modify Report: 20260226_070455 + +**Instruction:** Break it +**Target files:** src/foo.py +**Dry run:** False +**Backend:** ollama +**Branch:** N/A +**Result:** FAILED +**Error:** Tests failed after 1 attempt(s). +**Commit:** none +**Attempts:** 1 +**Autonomous cycles:** 0 + +## Attempt 1 -- complete + +### LLM Response +``` +llm raw +``` + +### Edits Written +#### src/foo.py +```python +x = 1 + +``` + +### Test Result: FAILED +``` +1 failed +``` diff --git a/data/self_modify_reports/20260226_070455_do_something_vague.md b/data/self_modify_reports/20260226_070455_do_something_vague.md new file mode 100644 index 00000000..dce18a56 --- /dev/null +++ b/data/self_modify_reports/20260226_070455_do_something_vague.md @@ -0,0 +1,12 @@ +# Self-Modify Report: 20260226_070455 + +**Instruction:** do something vague +**Target files:** (auto-detected) +**Dry run:** False +**Backend:** ollama +**Branch:** N/A +**Result:** FAILED +**Error:** No target files identified. Specify target_files or use more specific language. +**Commit:** none +**Attempts:** 0 +**Autonomous cycles:** 0 diff --git a/data/self_modify_reports/20260226_070455_fix_foo.md b/data/self_modify_reports/20260226_070455_fix_foo.md new file mode 100644 index 00000000..9978258e --- /dev/null +++ b/data/self_modify_reports/20260226_070455_fix_foo.md @@ -0,0 +1,31 @@ +# Self-Modify Report: 20260226_070455 + +**Instruction:** Fix foo +**Target files:** src/foo.py +**Dry run:** False +**Backend:** ollama +**Branch:** N/A +**Result:** FAILED +**Error:** Tests failed after 1 attempt(s). +**Commit:** none +**Attempts:** 1 +**Autonomous cycles:** 0 + +## Attempt 1 -- complete + +### LLM Response +``` +llm raw +``` + +### Edits Written +#### src/foo.py +```python +x = 2 + +``` + +### Test Result: FAILED +``` +FAILED +``` diff --git a/data/self_modify_reports/20260226_070455_fix_foo_important_correction_from_previ.md b/data/self_modify_reports/20260226_070455_fix_foo_important_correction_from_previ.md new file mode 100644 index 00000000..5cd91d3e --- /dev/null +++ b/data/self_modify_reports/20260226_070455_fix_foo_important_correction_from_previ.md @@ -0,0 +1,34 @@ +# Self-Modify Report: 20260226_070455 + +**Instruction:** Fix foo + +IMPORTANT CORRECTION from previous failure: +Fix: do X instead of Y +**Target files:** src/foo.py +**Dry run:** False +**Backend:** ollama +**Branch:** N/A +**Result:** SUCCESS +**Error:** none +**Commit:** abc123 +**Attempts:** 1 +**Autonomous cycles:** 0 + +## Attempt 1 -- complete + +### LLM Response +``` +llm raw +``` + +### Edits Written +#### src/foo.py +```python +x = 2 + +``` + +### Test Result: PASSED +``` +PASSED +``` diff --git a/src/dashboard/templates/mobile_test.html b/src/dashboard/templates/mobile_test.html index e0662ae7..c6d31cca 100644 --- a/src/dashboard/templates/mobile_test.html +++ b/src/dashboard/templates/mobile_test.html @@ -343,15 +343,41 @@ const pct = TOTAL ? Math.round((passed / TOTAL) * 100) : 0; const color = failed > 0 ? "var(--red)" : "var(--green)"; - summaryBody.innerHTML = ` -