A vulnerability in pomelo

A vulnerability in pomelo #1149

 

 

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

 

 

whtiehack commented 1 hour ago

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

@whtiehack

 

 

whtiehack commented 1 hour ago

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

 

 

whtiehack commented 35 minutes ago

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 pinuspinus 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 28 minutes ago

@whtiehack

Prevent calls constructor. because NetEase/pomelo#1149

839f8dd

whtiehack added a commit to whtiehack/pomelo that referenced this issue 15 minutes ago 

@whtiehack

temporary fix NetEase#1149

Verified

5b999c5

@whtiehack whtiehack referenced this issue 15 minutes ago

temporary fix #1149 #1150

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值