Coder Social home page Coder Social logo

auth0-cas-server's People

Contributors

sandrinodimattia avatar twistedstream avatar williamthorsen avatar

Stargazers

 avatar  avatar  avatar

Watchers

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

auth0-cas-server's Issues

Add tests

It should be trivial to at least add some integration tests around the endpoints and flows exposed by the src/server.js file since the hosting of Express has been decoupled and moved into the index.js (local hosting) and webtask.js (webtask hosting) files.

Address vulnerabilities in the CAS validate endpoint

The CAS /validate endpoint (as well as the inherited /serviceValidate (CAS 2.0) and /p3/serviceValidate (CAS 3.0) endpoints) has a few minor security vulnerabilities:

  1. Unlike the OIDC/Auth2 equivalent /token endpoint, the CAS /validate endpoint does not require any form of client credentials (eg. client_id/client_secret). Consequently if a malicious user were to intercept a ticket during the redirect back to the CAS application, then they could possibly call the /validate endpoint first and obtain the user's profile information. Luckily they wouldn't be able to authenticate as the user and log into the CAS application because that call would have to have been made from within the CAS application so that a local session could be generated.

  2. However, if the malicious user was able to perform the above interception, they could simply complete the login flow with the CAS application first and thereby hijack the user's session. OIDC/OAuth2 solves this using the state parameter, which CAS doesn't have an equivalent of. In OIDC/OAuth2, the malicious user would not have the required cookie on their browser correlating the state parameter, so if they attempted to hijack the session using just the redirect URL, their call to the application server would be rejected.

One solution to improve security with the CAS /validate endpoint implementation in this sample would be to add IP filtering on the /validate endpoint so that only certain IPs (eg. those of the CAS applications) would be allowed to call the endpoint. This would guard against the first scenario above which would at least prevent a malicious user from obtaining another user's profile attributes. For this to work well with our sample, we'd need to confirm that external IPs can be detected in the Webtask environment as well.

At a minimum, we should include a security warning in the README.

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.