Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A state poisoning vulnerability in pomelo #1149

Closed
xiaofen9 opened this issue Nov 8, 2019 · 5 comments · Fixed by topfreegames/pomelo#4
Closed

A state poisoning vulnerability in pomelo #1149

xiaofen9 opened this issue Nov 8, 2019 · 5 comments · Fixed by topfreegames/pomelo#4

Comments

@xiaofen9
Copy link

xiaofen9 commented Nov 8, 2019

We found that pomelo allows external control of critical state data. A malicious user-input can corrupt arbitrary methods and attributes in template/game-server/app/servers/connector/handler/entryHandler.js because certain internal attributes can be overwritten via a conflicting name. Hence, a malicious attacker can launch attacks by adding additional attributes to user-input.

A detailed discussion of the vulnerability can be found here.
https://github.com/cl0udz/vulnerabilities/tree/master/pomelo-critical-state-manipulation

@whtiehack
Copy link
Contributor

It seems to be a serious problem.
I'll test it.

@whtiehack
Copy link
Contributor

This problem does exist and can be simplified to understand and test as this:


var Handler = function (app) {
    this.app = app;

    if (!this.app)
        console.log("error")

};

Handler.prototype.entry = function () {
    console.log('entry', this.app.rpc.auth)
}

let h = new Handler({rpc: {auth: {}}})
console.log('h')
h.entry()
h.constructor({get: {}})
h.entry()


@whtiehack
Copy link
Contributor

image

The temporary solution is to check routeRecord.method in lib/server/server.js globalHandle.

if(routeRecord.method =="constructor"){
  return cb(new Error("unknow method"))
}

There is no need to worry about using pinus, pinus does not have this problem.


class PinusHandler {
    constructor(app) {
        this.app = app;

        if (!this.app)
            console.log("error")

    }

    entry() {
        console.log('entry', this.app.rpc.auth)
    }
}

let ph = new PinusHandler({rpc: {auth: {}}})
console.log('ph')
ph.entry()
ph.constructor({get: {}})
ph.entry()

image

thanks for @xiaofen9

whtiehack added a commit to node-pinus/pinus that referenced this issue Nov 8, 2019
@zdhsoft
Copy link

zdhsoft commented Nov 8, 2019

放弃吧,网易的搞的这个,有头没尾的。

fantasyni added a commit that referenced this issue Nov 8, 2019
@xiaofen9 xiaofen9 changed the title A vulnerability in pomelo A state poisoning vulnerability in pomelo Nov 11, 2019
alexandreab pushed a commit to alexandreab/pomelo that referenced this issue Mar 23, 2020
(cherry picked from commit 5b999c5)
alexandreab pushed a commit to alexandreab/pomelo that referenced this issue Mar 23, 2020
(cherry picked from commit 5b999c5)
@alexandreab
Copy link

Is this constructor the single one "exploitable" known? Are there other methods that can be overwritten like this?

alexandreab pushed a commit to alexandreab/pomelo that referenced this issue Mar 26, 2020
(cherry picked from commit 5b999c5)
henrod pushed a commit to topfreegames/pomelo that referenced this issue Mar 26, 2020
(cherry picked from commit 5b999c5)
alexandreab pushed a commit to alexandreab/pomelo that referenced this issue Apr 16, 2020
(cherry picked from commit 5b999c5)
henrod pushed a commit to topfreegames/pomelo that referenced this issue Apr 16, 2020
(cherry picked from commit 5b999c5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants