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

Local/Remote Crash (DoS) in SET_CAR #74

Closed
Halcy0nic opened this issue Jul 6, 2022 · 3 comments
Closed

Local/Remote Crash (DoS) in SET_CAR #74

Halcy0nic opened this issue Jul 6, 2022 · 3 comments

Comments

@Halcy0nic
Copy link

Hi!

Love the npl tool, I think it's super creative and really easy to use.

Brief Summary

While I was using the tool I had my fuzzer running in the background and came across a local/remote crash (DoS condition) as a result of slightly malformed input. Running the tool as a daemon/service (via inetd or some other means) would cause it to crash for all users accessing npl. The issue comes from invoking the SET_CAR function on an Atom when the input is malformed.

Reproduction

I've attached the input for reproduction purposes. After running npl against the input you can see following the GDB trace:

./npl -s ./input_file

gdb_nprolog_segfault

gdb_nprolog_set_car

Below is the hex dump of the input file:
xxd_crash_nprolog

A similar process could be repeated for GET_CAR
files.zip

@sasagawa888
Copy link
Owner

Thank you for the bug report. I will consider how to deal with it.

@sasagawa888
Copy link
Owner

I fixed it. I changed to consult/1 from reconsult/1 in -s mode.

tests/bug.pl
.0.

npl -s tests/bug.pl
Syntax error assertz .0
around here line=1 column=0
?-

@Halcy0nic
Copy link
Author

Sweet!

Thanks

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

2 participants