Skip to content

Malicious user can trigger recursion overflow #393

@rjschwei

Description

@rjschwei

The configuration merge algorithm introduced in #390 does not have a safeguard against a maliciously introduced recursion attack.

https://github.com/SUSE/suse-migration-services/blob/master/suse_migration_services/migration_config.py#L90

will recurs until recursion depth exception is reached when a specific config file is constructed, for example:

dict1 = { 'foo': { 'foo' : 'bar'}}

dict2 = { 'foo': {'foo': {'foo': {'foo' .........}}}}}

When dict to is an "endlessly" nested dict with the same key the algorithm will eventually reach the recursion depth limit and trigger a traceback.

We should have a recursion depth limit counter and when reached break out of the recursive loop.

It may also make sense to only accept known values in the configuration.

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