Skip to content

State leak in worker mode: objectHashes not cleared on exception in TypedMapperInterface #24

@Cafeine42

Description

@Cafeine42

Hello,

Using FrankenPHP in worker mode with Caddy, objectHashes is not cleared if an error occurs during MicroMapper usage.

When an error is thrown, the map code is not wrapped in a try/finally, so objectHashes isn't reset. This can cause spl_object_hash() to return a reused value on a new object in a future request, leading to side effects.

In our case, this happens when validation exceptions are thrown from implementations of TypedMapperInterface, which is part of the expected behavior.

Suggested fix: maybe wrap processing in try/finally

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions