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

Fatal error in CsvEncoder #54709

Closed
Rudloff opened this issue Apr 23, 2024 · 0 comments
Closed

Fatal error in CsvEncoder #54709

Rudloff opened this issue Apr 23, 2024 · 0 comments

Comments

@Rudloff
Copy link

Rudloff commented Apr 23, 2024

Symfony version(s) affected

7.0.6

Description

Fuzzing reveals that CsvEncoder throws a fatal error with some values:

PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /home/pierre/www/fuzzer/vendor/symfony/serializer/Encoder/CsvEncoder.php:179

How to reproduce

Here is the smallest value I was able to reproduce with:

<?php

require __DIR__.'/vendor/autoload.php';

$encoder = new \Symfony\Component\Serializer\Encoder\CsvEncoder();
var_dump($encoder->decode(',.
,', 'csv'));

Possible Solution

No response

Additional Context

I am using php-fuzzer to test various input.

@Rudloff Rudloff added the Bug label Apr 23, 2024
@fabpot fabpot closed this as completed May 1, 2024
fabpot added a commit that referenced this issue May 1, 2024
…eys (xabbuh)

This PR was merged into the 5.4 branch.

Discussion
----------

[Serializer] convert empty CSV header names into numeric keys

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #54709
| License       | MIT

Commits
-------

93ee57b convert empty CSV header names into numeric keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants