Skip to content

#2768 Improve email rendering#2769

Merged
sosnovsky merged 11 commits into
masterfrom
issue-2768-improve-thread-view-email-rendering
Jul 17, 2026
Merged

#2768 Improve email rendering#2769
sosnovsky merged 11 commits into
masterfrom
issue-2768-improve-thread-view-email-rendering

Conversation

@martgil

@martgil martgil commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

This PR improves HTML email rendering on thread view and other related files.

close #2768


Tests (delete all except exactly one):

  • Tests added or updated

To be filled by reviewers

I have reviewed that this PR... (tick whichever items you personally focused on during this review):

  • addresses the issue it closes (if any)
  • code is readable and understandable
  • is accompanied with tests, or tests are not needed
  • is free of vulnerabilities
  • is documented clearly and usefully, or doesn't need documentation

@martgil
martgil requested a review from sosnovsky as a code owner June 30, 2026 07:14
@martgil
martgil marked this pull request as draft June 30, 2026 07:14
@martgil
martgil marked this pull request as ready for review June 30, 2026 10:02
@martgil

This comment was marked as outdated.

Comment thread FlowCryptAppTests/Core/HTMLSanitizationTests.swift Outdated
Comment thread FlowCryptUI/Nodes/WebNode.swift Outdated
@martgil
martgil requested a review from sosnovsky July 1, 2026 08:18
Comment thread FlowCryptUI/Cell Nodes/ThreadDetailWebNode.swift Outdated
@martgil
martgil marked this pull request as draft July 3, 2026 11:06
@martgil
martgil marked this pull request as ready for review July 9, 2026 07:51
@martgil
martgil requested a review from sosnovsky July 9, 2026 07:51
@martgil

martgil commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

Hi @sosnovsky - This one is ready for a review. Thank you!

Comment on lines +120 to +123
// SanitizeHtml replaces > with &gt; and < with &lt; so need to convert them back
self.quote = try await (Core.shared.sanitizeHtml(html: quote))
.replacingOccurrences(of: "&gt;", with: ">")
.replacingOccurrences(of: "&lt;", with: "<")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

with this change, attacker can put &gt; and &lt; in the original message content, and it'll be converted to > and < on message render.

for example, attacker sends message with &lt;img src=x onerror=&quot;alert('xss')&quot;&gt;, it passes our html sanitizer and converted to <img src=x onerror="alert('xss')">

@sosnovsky

Copy link
Copy Markdown
Collaborator

Hi @martgil, have you tested my latest update here - does it work well for you? If so, I'll merge it

@martgil

martgil commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator Author

Yes @sosnovsky - I have completed testing the latest update and it works well on my side.

@sosnovsky
sosnovsky merged commit 34da4bb into master Jul 17, 2026
9 checks passed
@sosnovsky
sosnovsky deleted the issue-2768-improve-thread-view-email-rendering branch July 17, 2026 11:39
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.

Improve thread view email rendering

2 participants