Closed nadirrrr closed 6 years ago
@nadirio I see we removed the 'get-build-log'
endpoint for socket.io, are you sure build streaming still works with this removed?
Hi @odino! Yes I did. And I am sure. As we can see here https://github.com/namshi/roger/pull/33/commits/b5381efc9dad30d4c534fe08536a3e3317461af6#diff-8b7ac49cbb975e91e103ff6dad18ec2cL36 and https://github.com/namshi/roger/pull/33/commits/b5381efc9dad30d4c534fe08536a3e3317461af6#diff-8b7ac49cbb975e91e103ff6dad18ec2cL4, socket.io-stream was removed on the client side, meaning we do not require the event anymore.
Thanks a bunch!
CORS enabled by default on socket.io server, allowing cross origin requests
The CORS configuration is enabled by default by socket.io, and roger hasn't set the configuration, therefore socket.io will respond to requests from other origins with the Access-Control-Allow-Credentials and Access-Control-Allow-Origin on any request. This will allow an attacker to make cross-origin requests to the socket.io server, as every origin is allowed.
The CORS misconfiguration could be fruther escalated due to a path traversal vulnerability. This would allow an attacker to:
The attacker requires the following from the victim:
Proof of Concept
My first thought was that the socket.io server wasn't used anymore, but apparently it is still required. I have set socket.io to only accept the origin specified in the configuration file at
app.url
. This should fix the issue and disallow any other origins to interact with the socket.io server.I have removed the
get-build-log
event as it's not required anymore. The functionality was removed on the client side in #33.I have used https://socket.io/docs/server-api/#server-origins-fn.