mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
SECURITY: SSRF vulnerability in TopicEmbed
Block redirects when making the final request in TopicEmbed to prevent Server Side Request Forgery (SSRF)
This commit is contained in:
@@ -126,8 +126,8 @@ class TopicEmbed < ActiveRecord::Base
|
||||
return if uri.blank?
|
||||
|
||||
begin
|
||||
html = uri.read
|
||||
rescue OpenURI::HTTPError, Net::OpenTimeout
|
||||
html = FinalDestination::HTTP.get(uri)
|
||||
rescue OpenURI::HTTPError, Net::OpenTimeout, FinalDestination::SSRFDetector::DisallowedIpError
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user