Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unmarshalling option to disable local file loading #16

Open
jazeved0 opened this issue Jun 10, 2020 · 0 comments
Open

Add unmarshalling option to disable local file loading #16

jazeved0 opened this issue Jun 10, 2020 · 0 comments

Comments

@jazeved0
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant