Skip to content

Fatal error in CsvEncoder #54709

Closed
Closed
@Rudloff

Description

@Rudloff

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions