8000 HTML: Fix XSS vulnerability in description/comments by SamantazFox · Pull Request #4852 · iv-org/invidious · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

HTML: Fix XSS vulnerability in description/comments #4852

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 24, 2024
Merged
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
8 changes: 7 additions & 1 deletion src/invidious/videos/description.cr
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ def parse_description(desc, video_id : String) : String?
return "" if content.empty?

commands = desc["commandRuns"]?.try &.as_a
return content if commands.nil?
if commands.nil?
# Slightly faster than HTML.escape, as we're only doing one pass on
# the string instead of five for the standard library
return String.build do |str|
copy_string(str, content.each_codepoint, content.size)
end
end

# Not everything is stored in UTF-8 on youtube's side. The SMP codepoints
# (0x10000 and above) are encoded as UTF-16 surrogate pairs, which are
Expand Down
Loading
0