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

Invalid URIs flood the log output with stack traces #8

Open
wnortje opened this issue Jun 21, 2022 · 3 comments
Open

Invalid URIs flood the log output with stack traces #8

wnortje opened this issue Jun 21, 2022 · 3 comments

Comments

@wnortje
Copy link

wnortje commented Jun 21, 2022

Invalid URLs (e.g. /index.php?s=/Index/\x5C) cause puri:uri-parse-error errors which Hunchentoot catches and then prints a stack trace to the log output. This quickly floods the log file when the app is open to the internet.

This code works around the problem

(defmethod hunchentoot:maybe-invoke-debugger ((condition puri:uri-parse-error))
  (call-next-method)
  (hunchentoot:log-message* :error "~A" condition)
  (setf (hunchentoot:return-code*) hunchentoot:+HTTP-BAD-REQUEST+)
  (hunchentoot:abort-request-handler))

A better solution is probably for easy-routes to catch these errors and convert them to Hunchentoot's native error class and then let Hunchentoot deal with them.

@mmontone
Copy link
Owner

Thanks for reporting. I'll see if I apply your solution, or something else.

@vindarel
Copy link

my 2c: I've had a couple bugs with Puri, but none with Quri: https://github.com/fukamachi/quri

;; works:
(quri:parse-uri "/index.php?s=/Index/??=?")
=>
NIL
NIL
NIL
NIL
"/index.php"
"s=/Index/??=?"
NIL

;; with Puri: uri-parse-error

etc

@mmontone
Copy link
Owner

Good to know. I may try to switch to quri then..

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

3 participants