Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@ public virtual string ReplaceCssVariables(string html)
html = html.Replace("var(--ide-background-color)", isDarkTheme ? "#242424" : "#FBFBFB");
html = html.Replace("var(--dimmed-text-color)", VSColorTheme.GetThemedColor(EnvironmentColors.ScrollBarThumbPressedBackgroundBrushKey).ToHex());

html = html.Replace("${headerEnd}", "");
// Must not have blank template replacements, as they could be used to skip the "${nonce}" injection check
// and still end up with the nonce injected, e.g. "${nonce${resolvesToEmpty}}" becomes "${nonce}" - See IDE-1050.
html = html.Replace("${headerEnd}", " ");
var nonce = GetNonce();
html = html.Replace("${nonce}", nonce);
html = html.Replace("ideNonce", nonce);
html = html.Replace("${ideScript}", "");
html = html.Replace("${ideScript}", " ");

return html;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ public override string GetInitScript()

public override string ReplaceCssVariables(string html)
{
html = html.Replace("${ideStyle}", "");
// Must not have blank template replacements, as they could be used to skip the "${nonce}" injection check
// and still end up with the nonce injected, e.g. "${nonce${resolvesToEmpty}}" becomes "${nonce}" - See IDE-1050.
html = html.Replace("${ideStyle}", " ");
return base.ReplaceCssVariables(html);
}

Expand Down
Loading