Giter VIP home page Giter VIP logo

urlevaluator's People

Contributors

duetosymmetry avatar nicolassmith avatar tbroyer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

urlevaluator's Issues

Potential vulnerability in handling intents

Hi,

The intent filters specify list of known hosts. But in UrlEvaluatorActivity activity, the URL is not checked if it is really out the lists specified in the manifest file. This can be used maliciously as follows:

A malicious app can send an explicit intent to the app. Because this app does not check if it is one of those possible short URLs, it tries to connect to the passed URL. The URL is hosted on a domain that is controlled by the attacker. Therefore the malicious server sets Content-Location part of the header with a URL containing encoded part of a malware binary (e.g., myprotocl://abc.com/content=123FE435...). The app extracts this location and tries to create a new intent with VIEW action. If the malicious app has an intent filter with any host (host=""), scheme="myscheme" and pathPattern="/content=.", then it will receive the malware content. If the size does not permit, it can perform several similar queries to collect the parts of the malware.

Can you confirm this possible vulnerability, please?

Test infrastructure

Could possibly be useful to have an activity that makes a bunch of intents based on some test short urls to make sure that changes don't break things.

Add j.mp

Just clicked through a j.mp link that urlevaluator didn't detect: https://twitter.com/typekit/status/312283964322746368 (it resolved the t.co but then displayed evaluated as <the j.mp URL> and opened a browser (or in my case, showed the chooser to select a browser, no Short URL Evaluator in the list)

What to do about redirection to mobile sites

The problem is as follows:

  1. tinyurl (and potentially others) always has more than one redirect (first a 301 redirect, and then a javascript redirect) before going to the intended destination.
  2. Thus I made the MultipleRedirectEvaluatorTask class, so that we only return the url once we go all the way down the rabbit hole.
  3. But some websites (yelp.com) have a redirect (of type 303) that point to the mobile site, which is not the real intended destination.

Possible solutions:

  1. Fake the user agent (what does the android HttpConnection use?) to hide that we are a mobile device, thus preventing mobile redirect. However, when I tried this, this broke t.co links (they responded with 200 OK and no redirect, I still don't understand why this happened).
  2. Don't use MultipleRedirect at all, just let an intent get thrown at each step of the way. Slightly ugly and annoying, but possibly more robust.
  3. Only follow certain types of redirects (ie only 301, not 303) this is the current solution, but what happens if there is a redirector service that does use 303? It seems that some (youtu.be) use 302. Are we safe to redirect on everything except 303?
  4. In the case of tinyurl, we know that there are 2 redirects, should we just keep track of how many redirects we expect, and only go to that depth before returning? This seems robust but requires more maintenance.

Adding more hosts to MultipleRedirect

Now that the multiple redirect class is fairly robust I was thinking of making t.co use it due to the fact that those are often multiple redirects.

Alternatively we could make the multiple redirect class be the default one. Thoughts?

Clarify the project licensing

Before I start contributing, I'd like to know which license you chose for the project? Apache 2.0, Public Domain, MIT, BSD, GPL?

Some URLs not evaluating

1:56 PM Leo: bork bork bork
something is borked in urlevaluator
i hvaen't debugged it
1:57 PM but i imagine it has something to do with HEAD requests not working out?
i should look into it
7 minutes
2:04 PM me: can you email me a url that is borked?
Leo: lemme see
2:06 PM check this one ...
http://ow.ly/kxPwZ
2:07 PM except i'm not sure if that is the actual URL
because on twitter sometimes people tweet short URLs and twitter reshortens them, stupidly
2:08 PM also
http://qr.ae/TEhXB
5 minutes
2:13 PM me: yes, i get errors on those
but i can't debug right now
2:14 PM Leo: no prob bob
do you send any request headers?
2:15 PM it looks like ow.ly requires a Host:ow.ly request header
i tried this with telnet by hand :P
old school, yo
if I leave off that header, it gives a 503. If I give just that one header, I get a 301 Moved
2:17 PM me: did owly work before we made request("HEAD")?
2:18 PM Leo: yeah
me: hmmm
Leo: oh maybe? idk
i wsa just assuming
ass u me
me: can you open an issue and put this info in it
Leo: haha good idea

Shortener for Oxford

oxford.ly
This is dumb, the domain name is longer than oed.com. nonetheless, this is a dedicated shortening service

Infinite redirect loop

t.co seems to give infinite redirect loops. This basically makes Twitter unusable. I'm traveling tomorrow to a conference so won't have a chance to investigate further until a week from now.

google.com/?url=

Google Now and news apps use this URL form which all opens in the browser. It would be nice if these were caught, evaluated, and send to the correct apps.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.