Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Probably already exists but I want something that uses revealing Module Pattern javascript convention to find 'leaky' objects which are giving users access to commands that they shouldn't be able to use
- I dunno but
- imagine
- userObject.js
- ```
- function User(username,password) {
- this.username:username,
- this.password: password
- }
- module.exports = User
- ```
- userNicky.js
- ```
- //let Nick =new User(Nicky,12321332) creates the user
- let User = require('./userObject.js')
- Nick = {
- username:Nicky
- password:12321332
- }
- module.exports=Nick //should only export Nick.username
- ```
- window.js
- ```
- let nickname = require('./userNicky')
- console.log(`this user is called ${nickname.username}`)
- ```
- but this would still allow you to see the password property of the nickname object
- so console.log(nickname.password) would let us see the password of username
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement