Skip to content

Add unmarshalling option to disable local file loading #16

Open
@jazeved0

Description

@jazeved0

As it stands, the library unconditionally loads the contents from the file system when using the URL directive (:<), both in standard attributes and in control values. However, this makes the parser unusable for loading untrusted input without first sanitizing it. As the LDIF RFC spec notes, care should be taken when parsing untrusted input, as the file URL functionality allows malicious actors to read files from the local system (such as /etc/hostname or /etc/passwd).

While it's possible to disable the parsing of Controls entirely with the Controls boolean flag in the LDIF struct (which has the effect of disabling loading files inside control values), it's not possible to disable this behavior for attribute values. It would be preferrable to have some additional option when calling ldif.Unmarshal that allows for turning off the parser's behavior of following and loading file URLs when using the :< directive.

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