mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibMarkdown: Wrap code block language string in escape_html_entities()
This would allow HTML injection as the string was inserted into the HTML output with no sanitation whatsoever. Fixes #7123.
This commit is contained in:
@@ -39,7 +39,7 @@ String CodeBlock::render_to_html() const
|
||||
if (style_language.is_empty())
|
||||
builder.append("<code>");
|
||||
else
|
||||
builder.appendff("<code class=\"{}\">", style_language);
|
||||
builder.appendff("<code class=\"{}\">", escape_html_entities(style_language));
|
||||
|
||||
if (style_language == "js")
|
||||
builder.append(JS::MarkupGenerator::html_from_source(m_code));
|
||||
|
||||
Reference in New Issue
Block a user