Skip to content
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

When try to get body I have error NoMethodError: undefined method `closed?' for nil:NilClass #58

Closed
DmytroKondratiuk opened this issue Sep 15, 2022 · 7 comments

Comments

@DmytroKondratiuk
Copy link

DmytroKondratiuk commented Sep 15, 2022

In version "1.1.0" when try to get body I have error. For example:

 photo_url = any photo url
 SsrfFilter.get(photo_url).body

Error:

NoMethodError: undefined method `closed?' for nil:NilClass
raise IOError, 'attempt to read body out of block' if @socket.closed?
@arkadiyt
Copy link
Owner

Can you share a sample url to reproduce the issue?

@nickcoyne
Copy link

I get this same error with Carrierwave trying to set a remote url for an image.

@arkadiyt
Copy link
Owner

Can you share a sample url to reproduce the issue?

@nickcoyne
Copy link

I think my issue is caused by #56

@DmytroKondratiuk
Copy link
Author

For example
photo_url = 'https://ssl.gstatic.com/ui/v1/icons/mail/rfr/logo_gmail_lockup_dark_2x_r5.png'

Screenshot 2022-09-16 at 09 42 02

In version 1.0.8 when we try get a photo SsrfFilter.get(photo_url) answer:

#<Net::HTTPOK 200 OK readbody=true>

In version 1.1.0 when we try get a photo SsrfFilter.get(photo_url) answer:

#<Net::HTTPOK 200 OK readbody=false>

@vinc
Copy link

vinc commented Oct 4, 2022

Same issue for a private project that was solved by downgrading to 1.0.8

yheuhtozr added a commit to yheuhtozr/forem that referenced this issue Oct 11, 2022
mshibuya added a commit to mshibuya/ssrf_filter that referenced this issue Oct 23, 2022
mshibuya added a commit to mshibuya/ssrf_filter that referenced this issue Oct 23, 2022
@basex
Copy link

basex commented Feb 6, 2023

I confirm the fix by #60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants