Sentry-php: BUG: Crash of RequestIntegration with $_SERVER global with integer keys.

Created on 8 Oct 2019  路  4Comments  路  Source: getsentry/sentry-php

The dependency zendframework/zend-diactoros does not allow an $_SERVER super-global with keys that are integers (is php valid), leading to a request crash ('white screen of death').

It's used by RequestIntegration on https://github.com/getsentry/sentry-php/blob/master/src/Integration/RequestIntegration.php#L101

To reproduce install sentry-symfony on an nginx + php-fpm environment and add the following line to the php-fpm pool config:

env[42] = crash

More details on: https://github.com/zendframework/zend-diactoros/issues/369

Confirmed Won't fix Bug

Most helpful comment

I would say that populating $_SERVER with custom values is not a good practice, but I can see how that shouldn't lead to a hard crash.

This is anyhow a downstream bug, so we shouldn't do anything. I'll leave this open to track the Diactoros issue.

All 4 comments

I would say that populating $_SERVER with custom values is not a good practice, but I can see how that shouldn't lead to a hard crash.

This is anyhow a downstream bug, so we shouldn't do anything. I'll leave this open to track the Diactoros issue.

I know, we are trying to update sentry-symfony version, and I don't now where the integer key comes from, but I lose lots of hours tracking this.
I open this here just for you to have the information so you could decide about to implement some defensive programming.

For reference: we are using env vars for config that we pass using php-fpm pool config. One env var happens to have the same name as a php constant so the constant is translated to it's value on the file, hence the integer key on $_SERVER global.

FTR: https://github.com/zendframework/zend-diactoros/pull/370 has been merged and released as 2.1.4.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

m1guelpf picture m1guelpf  路  7Comments

brunowowk picture brunowowk  路  5Comments

JanMikes picture JanMikes  路  4Comments

codepuncher picture codepuncher  路  6Comments

mitchhentges picture mitchhentges  路  3Comments