Should makeRequest follow redirects?

13 views
Skip to first unread message

Jon

unread,
Nov 11, 2009, 6:44:15 PM11/11/09
to OpenSocial - OpenSocial and Gadgets Specification Discussion
Should makeRequest, HttpRequest and other related queries follow
redirects?

Shindig, by default does not, but our extension did, and the spec does
not really state a behavior. It seems to be a simple option for
various http utilities.

How have others implemented their servers?

Paul Lindner

unread,
Nov 15, 2009, 2:59:03 AM11/15/09
to opensocial-an...@googlegroups.com
You have to be very careful with redirects.  If your http client library follows redirects you can open potential security holes.

Consider the following scenario:

1. Your fetch client forbids requests to internal networks like 127.0.0.1
2. A malicious user creates a public endpoint that redirects to 127.0.0.1
3. Your http client implementation blindly follows redirects.

By following redirects you negate all your careful checking in step 1.

Even worse if you have a stupid fetch library you could follow a redirect to file:///etc/passwd 




--

You received this message because you are subscribed to the Google Groups "OpenSocial and Gadgets Specification Discussion" group.
To post to this group, send email to opensocial-an...@googlegroups.com.
To unsubscribe from this group, send email to opensocial-and-gadg...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/opensocial-and-gadgets-spec?hl=.



Randy Hudson

unread,
Nov 17, 2009, 12:53:39 PM11/17/09
to OpenSocial - OpenSocial and Gadgets Specification Discussion
> Consider the following scenario:
>
> 1. Your fetch client forbids requests to internal networks like 127.0.0.1
> 2. A malicious user creates a public endpoint that redirects to 127.0.0.1
> 3. Your http client implementation blindly follows redirects.
>
> By following redirects you negate all your careful checking in step 1.

Exactly. One might even argue that 3 implies your failed to do 1 ;-)

I'd like to argue that makeRequest should behave the same way that
XMLHttpRequest does, meaning it should follow redirects by default,
perhaps with the restriction that the redirect be to an address on the
same site.

Randy Hudson

unread,
Nov 17, 2009, 12:53:07 PM11/17/09
to OpenSocial - OpenSocial and Gadgets Specification Discussion
> Consider the following scenario:
>
> 1. Your fetch client forbids requests to internal networks like 127.0.0.1
> 2. A malicious user creates a public endpoint that redirects to 127.0.0.1
> 3. Your http client implementation blindly follows redirects.
>
> By following redirects you negate all your careful checking in step 1.

Jon

unread,
Nov 17, 2009, 12:58:03 PM11/17/09
to OpenSocial - OpenSocial and Gadgets Specification Discussion
One possible method to eliminate redirects behind your firewall is to
ensure that your fetch client uses a proxy server that would forbid
the malicious redirect.

On Nov 14, 11:59 pm, Paul Lindner <lind...@inuus.com> wrote:
> You have to be very careful with redirects.  If your http client library
> follows redirects you can open potential security holes.
>
> Consider the following scenario:
>
> 1. Your fetch client forbids requests to internal networks like 127.0.0.1
> 2. A malicious user creates a public endpoint that redirects to 127.0.0.1
> 3. Your http client implementation blindly follows redirects.
>
> By following redirects you negate all your careful checking in step 1.
>
> Even worse if you have a stupid fetch library you could follow a redirect to
> file:///etc/passwd
>
> On Wed, Nov 11, 2009 at 3:44 PM, Jon <jon.weyga...@gmail.com> wrote:
> > Should makeRequest, HttpRequest and other related queries follow
> > redirects?
>
> > Shindig, by default does not, but our extension did, and the spec does
> > not really state a behavior. It seems to be a simple option for
> > various http utilities.
>
> > How have others implemented their servers?
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "OpenSocial and Gadgets Specification Discussion" group.
> > To post to this group, send email to
> > opensocial-an...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > opensocial-and-gadg...@googlegroups.com<opensocial-and-gadgets-spec%2Bunsu...@googlegroups.com>
> > .
Reply all
Reply to author
Forward
0 new messages