Skip to content

fix(console): render log output as text instead of html - #16

Merged
TheMeinerLP merged 5 commits into
mainfrom
fix/console-log-escaping
Oct 16, 2026
Merged

TheMeinerLP merged 5 commits into
mainfrom
fix/console-log-escaping

Conversation

@TheMeinerLP

Copy link
Copy Markdown

Description

The dashboard console rendered every log line with v-html after escaping only < and >. Characters that are significant inside an attribute value passed through unchanged. Log lines carry request paths and other server-side input, so this was an incomplete escape on an HTML injection sink.

This change parses log lines into plain text segments with a fixed set of style classes, and the view renders them with interpolation. No markup is built from log text, and Vue interpolation escapes &, <, >, " and ' itself. The ansi-to-html dependency is dropped, because a small SGR parser covers the codes the server emits.

Also included: a vitest and jsdom setup for the frontend (first suite lands with this fix) and a one-character style fix in the artifact snippet.

Intended for the 1.1.1 patch release.

Type of change

  • fix - bug fix
  • feat - new feature
  • refactor - internal change without behaviour change
  • perf - performance improvement
  • docs - documentation only
  • test - tests only
  • build / ci / chore - tooling, dependencies, pipelines
  • Breaking change (configuration, API or behaviour that existing deployments rely on)

How was this tested?

Targeted run locally:

  • ansi.test.js (vitest, jsdom): the SGR parser and the text segmentation, including markup-like input in log lines, which must come out as literal text.

The full suite runs in CI.

Checklist

  • Commit messages follow the Conventional Commits convention documented in CLAUDE.md (English, imperative, one of feat, fix, docs, refactor, test, build, ci, chore, perf)
  • Tests cover the change, or the change is not testable and I explained why above
  • ./gradlew build passes locally
  • Documentation and configuration samples are updated if the change is user-facing
  • Existing copyright headers are preserved; new files carry the appropriate header
  • No credentials, tokens or personal data are included in the diff

Add vitest and jsdom as dev dependencies, a test script and a vitest
config that runs the suite in a jsdom environment. The first test
suite lands with the console escaping fix.
The console rendered each log line with v-html after escaping only < and
>, so any character that is significant inside an attribute value was
passed through unchanged. Log lines carry request paths and other
server-side input, so that was an incomplete escape on an injection
sink.

Log lines are now parsed into plain text segments with a fixed set of
style classes, and the view renders them with interpolation. No markup
is built from log text, and interpolation escapes & < > " ' itself.
The ansi-to-html dependency is dropped because the small SGR parser
covers the codes the server emits.
@TheMeinerLP
TheMeinerLP merged commit 1364ee2 into main Oct 16, 2026
7 checks passed
@TheMeinerLP
TheMeinerLP deleted the fix/console-log-escaping branch October 16, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant