Skip to content

Security: parse_version eval #288

@rurban

Description

@rurban

get_version is dangerous code

Beware of the security issues for cpan testers or unchecked sources, as
the '$VERSION = ...' line in a .pm file is simply evaluated, without
any sanity check.

Allowed can only a $ver_qr with /^v? [\d_\.]+/ and /qv\($ver_qr\)/,
but for sure not any sub call or ; or eval

We cannot use Safe as it needs to run with miniperl, but at least a security sanity check is required.

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