Skip to content

security: harden template output escaping#761

Merged
RussH merged 8 commits intoopencats:masterfrom
anonymoususer72041:security/centralize-output-escaping
May 1, 2026
Merged

security: harden template output escaping#761
RussH merged 8 commits intoopencats:masterfrom
anonymoususer72041:security/centralize-output-escaping

Conversation

@anonymoususer72041
Copy link
Copy Markdown
Contributor

This PR centralizes template output escaping helpers and applies them to selected OpenCATS UI outputs.

It adds reusable escaping methods for HTML text, HTML attributes, URLs, and JavaScript string literals, then updates existing template output to use the appropriate helper for each context. The goal is to make escaping behavior more consistent and reduce the risk of XSS issues while keeping the changes minimal and close to the existing template structure.

The updated areas include template header output, candidate detail page output, contact detail page output, company detail page output, job order detail page output and activity-related output.

The changes intentionally avoid business logic changes, SQL changes, permission changes and layout restructuring. Activity notes continue to preserve line breaks where applicable, but are escaped at output time before formatting.

@anonymoususer72041 anonymoususer72041 added the security Pull requests that address a security vulnerability label Apr 26, 2026
@anonymoususer72041 anonymoususer72041 force-pushed the security/centralize-output-escaping branch from 25e0c32 to 9bcab32 Compare April 26, 2026 11:42
Copy link
Copy Markdown
Member

@RussH RussH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks clean - so long as there's no html expected in activities or questionnaire responses. The tests are good, too - thank you!

@RussH RussH merged commit 451b9a6 into opencats:master May 1, 2026
3 checks passed
@anonymoususer72041 anonymoususer72041 deleted the security/centralize-output-escaping branch May 1, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security Pull requests that address a security vulnerability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants