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

Is opium sanitising paths? #61

Open
ghost opened this issue Sep 7, 2016 · 1 comment
Open

Is opium sanitising paths? #61

ghost opened this issue Sep 7, 2016 · 1 comment

Comments

@ghost
Copy link

ghost commented Sep 7, 2016

Say one does:

let print_ymd =
  get "/:title"
      begin fun req ->
      let filename = param req "title" in
      let filepath = "dir/" ^ filename in
      `Html load_file filepath |> respond'
      end

There could be an issue with a malicious request containing ../../. But using telnet I noticed that opium seems to ignore the first ../../. Is that normal behaviour?

@rgrinberg
Copy link
Owner

I've added a test to verify that indeed opium route params don't match such params.

98fa61b

I'll have to investigate the cause of the redirection further. Perhaps it's done at the cohttp layer.

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