ekinhbayar / gitamp

Listen to music generated by events across github.
MIT License
29 stars 10 forks source link

Prevent scriptkiddies from breaking our glorious project #35

Closed PeeHaa closed 7 years ago

PeeHaa commented 7 years ago

There are some scanners doing post requests to random URLs.

This breaks our glorious project.

Example crash output:

GitAmp-Ubuntu php[12165]: [2017-02-10 10:06:37] critical LogicException: Cannot update resolved promise in /opt/gitamp/vendor/amphp/amp/lib/PublicPromisor.php:28 GitAmp-Ubuntu php[12165]: Stack trace: GitAmp-Ubuntu php[12165]: #0 /opt/gitamp/vendor/amphp/aerys/lib/Server.php(591): Amp\Deferred->update('cmd=%63%64%20%2...') GitAmp-Ubuntu php[12165]: #1 /opt/gitamp/vendor/amphp/aerys/lib/Server.php(567): Aerys\Server->onParsedEntityPart(Object(Aerys\Client), Array) GitAmp-Ubuntu php[12165]: #2 /opt/gitamp/vendor/amphp/aerys/lib/Http1Driver.php(498): Aerys\Server->onParseEmit(Object(Aerys\Client), 4, Array, NULL) GitAmp-Ubuntu php[12165]: #3 [internal function]: Aerys\Http1Driver->parser(Object(Aerys\Client)) GitAmp-Ubuntu php[12165]: #4 /opt/gitamp/vendor/amphp/aerys/lib/Server.php(555): Generator->send('POST /command.p...') GitAmp-Ubuntu php[12165]: #5 /opt/gitamp/vendor/amphp/amp/lib/NativeReactor.php(265): Aerys\Server->onReadable('000000003401e4c...', Resource id #88544, Object(Aerys\Client)) GitAmp-Ubuntu php[12165]: #6 /opt/gitamp/vendor/amphp/amp/lib/NativeReactor.php(249): Amp\NativeReactor->doIoCallback('000000003401e4c...', Object(stdClass), Resource id #88544) GitAmp-Ubuntu php[12165]: #7 /opt/gitamp/vendor/amphp/amp/lib/NativeReactor.php(214): Amp\NativeReactor->selectActionableStreams(0.8837) GitAmp-Ubuntu php[12165]: #8 /opt/gitamp/vendor/amphp/amp/lib/NativeReactor.php(71): Amp\NativeReactor->doTick(false) GitAmp-Ubuntu php[12165]: #9 /opt/gitamp/vendor/amphp/amp/lib/functions.php(46): Amp\NativeReactor->run(Object(Closure)) GitAmp-Ubuntu php[12165]: #10 /opt/gitamp/vendor/amphp/aerys/bin/aerys(99): Amp\run(Object(Closure)) GitAmp-Ubuntu php[12165]: #11 {main}

We should catch these and others and properly return a 404 response.

ekinhbayar commented 7 years ago

Fixed with aerys v0.4.7.