AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 47 Bitcoin

txscript: switch template engine from html/template to text/template

Public commit record

What the developer wrote

Authored by Erick Cestari

85/100 · Strong
txscript: switch template engine from html/template to text/template

html/template automatically HTML-escapes special characters to prevent
XSS, which can silently corrupt arbitrary script data. Since the output
is binary script bytes and not HTML, this escaping provides no benefit
and might breaks correctness.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

This commit swaps the template engine used to build Bitcoin scripts from Go's HTML-aware template package to a plain-text template package. The old engine would automatically escape characters like angle brackets and quotes for safe web display, but because the output here is raw binary script data, that escaping could quietly change the bytes produced. The fix removes a source of silent data corruption when users generate transaction scripts from templates.

Recommended action

Treat this as a correctness fix rather than an active exploit. Users who generated scripts via templates should review whether previously produced scripts were affected by HTML-style escaping, especially if templates contained characters such as `<`, `>`, `&`, or quotes. Consider adding tests that exercise templates with such characters to ensure script bytes match expectations.

Security signals we found

01

Silent data corruption in generated Bitcoin scripts

02

Template auto-escaping applied to non-HTML binary output

03

Potential script malleability or invalid-script risk

04

No input validation changes or bounds checks added

Risk score

Why this scored 47/100

Our methodology →
Potential impact 12/30
Exploitability 8/25
Stealth signal 10/15
Affected reach 7/15
Confidence 7/10
Evidence quality 3/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.