Description
The CLI exportSite() function builds HTML by string concatenation without escaping entity names, descriptions, or claim statements. This is the same XSS vulnerability as in the browser export, but in the CLI path.
Vulnerable Code
File: cli/index.ts (lines ~193-219)
if (entity.description) {
html += `\n <p>${entity.description}</p>\n`;
}
No escaping is applied to entity.description or claim.statement.
Impact
- Severity: Critical
- Exported static sites from CLI contain unescaped user content
- Same XSS risk as the browser export path
Recommended Fix
- Reuse
escapeHtml() from src/lib/security.ts in CLI export
- Consider sharing export logic between browser and CLI (currently duplicated)
- Add DOMPurify or equivalent sanitization for rich HTML content
Acceptance Criteria
Description
The CLI
exportSite()function builds HTML by string concatenation without escaping entity names, descriptions, or claim statements. This is the same XSS vulnerability as in the browser export, but in the CLI path.Vulnerable Code
File:
cli/index.ts(lines ~193-219)No escaping is applied to
entity.descriptionorclaim.statement.Impact
Recommended Fix
escapeHtml()fromsrc/lib/security.tsin CLI exportAcceptance Criteria