Git Product home page Git Product logo

gi-security's People

Contributors

abramovick avatar bochenski avatar bosdm avatar liamgiles avatar

Watchers

 avatar  avatar

gi-security's Issues

Allow overriding of default role names via setting

For cases where you are plugging into a legacy database that already has a role structure, allow the name of admin, restricted, sysadmin etc to be overriden by a setting. The setting name takes the form [Expected Gintellect Role Name]RoleName.

For example to override which role represents the Admin role, you would set the AdminRoleName setting.

Model layer should not expose methods on objects

So here is the problem, when for example we do a model.find, the object that is returned by mongoose (and passed straight through our model layer) has an update method, with direct access to the underlying database.

If an unsuspecting developer, were to say change the password on the user object, and then call update with the objects id, it would end up bypassing any useful checks the model layer was doing to protect itself.

This is too much power / responsibility for the controller, and needs to be locked down. Any methods exposed on objects that the model layer returns, must not be able to break the model.

I think that the simplest thing to do is call .toObject on the objects returned by mongoose, before returning them from the model layer. This means that there will be no functions on the objects returned to the controller layer at all.

The controllers then cannot call any methods on objects directly, but must instead use the interface provided by the model.

Use Angulars JSON Vulnrability Protection in all JSON replies

JSON Vulnerability Protection
A JSON vulnerability allows third party website to turn your JSON resource URL into JSONP request under some conditions. To counter this your server can prefix all JSON requests with following string ")]}',\n". Angular will automatically strip the prefix before processing it as JSON.

For example if your server needs to return:

['one','two']
which is vulnerable to attack, your server can return:

)]}',
['one','two']
Angular will strip the prefix, before processing the JSON.

Authenticate Socket IO connections

This will be mildly problematic, as currently crud connects to socket.io on first initialization, which is before a user has a chance to login.

So really we need to hook into the login event on the client and only attempt to connect then.

Logout is broken on Chrome (works ok in safari)

When you logout in chrome, I'm finding that the subsequent request to /api/user is still authenticated and as such the user is logged straight back in again. Presumably cookie related, doesn't happen on Safari, so not a server side issue.

Verify facebook login message sent from client

We should not trust that the client has not manipulated the facebook login message to gain access to others accounts. Need to verify the hash sent with the login message against our app secret.

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.