in reply to Re^2: :OWASP ESAPI Implementation for Perl?
in thread :OWASP ESAPI Implementation for Perl?

Basically I want a library I can run a url through before I redirect to it, to ensure it's not some type of security risk that I am unaware of.

Questions:

A URL is just that. You could check some basics:

After that, the browser leaves what you can control. You can't protect the browser user from being redirected to malicious pages. Simply because any sufficiently evil page can detect that you attempt to check it and present itself as a completely harmless page.

You can prevent information leakage. Many browsers sent a Referer header, so if the URL of the redirecting page contains sensitive information like a session ID, you may want to redirect via a "trampolin" page that is passed the redirection URL, and only that, as URL parameter. Perhaps you also want to create a new browser tab/window for the trampolin page.

If the redirection goes back to your own page / application, well, it should not be able to do any harm, because you validate all your input, properly encode / escape all your output, and use only DBI placeholders for database access. Also, your application runs with taint mode enabled, and it refuses to work on any input that can't be properly validated.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^4: :OWASP ESAPI Implementation for Perl?
by Anonymous Monk on Dec 20, 2010 at 04:08 UTC
    Hi - ESAPI isn't attempting any magic. We believe developers need to have a set of strong simple security controls available, and so we created an API and a reference implementation. We can't do the impossible, so there's only limited support for verifying URLs. However, there are lots of controls that you might find useful, including validation, canonicalization, encoding, encryption, authentication, access control, logging, random numbers, etc...
      We can't do the impossible, so there's only limited support for verifying URLs.

      Could you explain exactly what verification you do do? With examples of url's that would fail your verification?


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.