addresses #2498: Protect source downloader against server-side request forgery attacks
This commit is contained in:
@@ -359,5 +359,10 @@ module Danbooru
|
||||
def enable_post_search_counts
|
||||
false
|
||||
end
|
||||
|
||||
# For downloads, if the host matches any of these IPs, block it
|
||||
def banned_ip_for_download?(ip_addr)
|
||||
ip_addr =~ /^(?:127\.0\.0\.1|::1|169\.254\.\d+\.\d+|fe80::.*)$/
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user