-
Notifications
You must be signed in to change notification settings - Fork 189
Description
When server methods are called from the client side, the arguments XHRs are being also logged in the JS console. This opens up possibilities to intercept transmitted data by third party malicious code.
For the simplicity, let's suppose, we have the following client side code for logging the user in.
_onLogin(event) {
if (this.$.lusername.validate() && this.$.lpassword.validate()) {
this.$server.onLogin(this.$.lusername.value, this.$.lpassword.value);
}
}
Since all XHR requests are also logged in JS console, it is possible to get username and password from the client side:
console.log_ = console.log;
console.log = function(z) { if ((""+z).includes("onLogin")) alert(z); console.log_(z); }
The code could be injected via malicious browser add-ons, advertisement networks or via MitM attacks. Of cause, this is pretty synthetic example, as passwords should not be sent in a plain text, but this can be easily used to collect any personal data.
When production mode is used, the console logging should be stripped from JS code, so that it won't be possible to turn it on from the client.