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

Fallback to JSON renderer if no valid format is given #15590

Merged
merged 3 commits into from Feb 19, 2020
Merged

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Feb 18, 2020

Prevents exceptions like these which we are getting quite often due to security researchers trying different inputs

Call to a member function getResponseException() on null","file":"/core/API/Request.php","line":279,"request_id":"3e2b6","backtrace":" on /var/www/html/core/API/Request.php(279)\n#0 /plugins/API/Controller.php(41)

Ideally will add a test but probably won't find the time soon.

Prevents exceptions like these which we are getting quite often due to security researchers trying different inputs

> Call to a member function getResponseException() on null","file":"\/core\/API\/Request.php","line":279,"request_id":"3e2b6","backtrace":" on \/var\/www\/html\/core\/API\/Request.php(279)\n#0 \/plugins\/API\/Controller.php(41)

Ideally will add a test but probably won't find the time soon.
@tsteur tsteur added the Needs Review PRs that need a code review label Feb 18, 2020
@tsteur tsteur added this to the 3.13.3 milestone Feb 18, 2020
@mattab
Copy link
Member

mattab commented Feb 18, 2020

Example request that triggered error: POST: {"date":"last10","format":"-1 OR 2+931-931-1=0+0+0+1 --","idSite":"1","limitActionsPerStep":"5","method":"UsersFlow.getUsersFlow","module":"API","period":"day","token_auth":"XYZANONYMIZED","translateColumnNames":"1","format_metrics":"bc"}

@tsteur
Copy link
Member Author

tsteur commented Feb 19, 2020

Thanks @diosmosis

@tsteur tsteur merged commit 2ca0084 into 3.x-dev Feb 19, 2020
@tsteur tsteur deleted the jsonrenderer branch February 19, 2020 23:20
jonasgrilleres pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 22, 2020
* Fallback to JSON renderer if no valid format is given

Prevents exceptions like these which we are getting quite often due to security researchers trying different inputs

> Call to a member function getResponseException() on null","file":"\/core\/API\/Request.php","line":279,"request_id":"3e2b6","backtrace":" on \/var\/www\/html\/core\/API\/Request.php(279)\n#0 \/plugins\/API\/Controller.php(41)

Ideally will add a test but probably won't find the time soon.

* Add failing test.

* Fix test.

Co-authored-by: diosmosis <diosmosis@users.noreply.github.com>
jbuget pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 26, 2020
* Fallback to JSON renderer if no valid format is given

Prevents exceptions like these which we are getting quite often due to security researchers trying different inputs

> Call to a member function getResponseException() on null","file":"\/core\/API\/Request.php","line":279,"request_id":"3e2b6","backtrace":" on \/var\/www\/html\/core\/API\/Request.php(279)\n#0 \/plugins\/API\/Controller.php(41)

Ideally will add a test but probably won't find the time soon.

* Add failing test.

* Fix test.

Co-authored-by: diosmosis <diosmosis@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants