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

Review old security audit #518

Closed
4 tasks done
jpmckinney opened this issue Jul 17, 2024 · 0 comments
Closed
4 tasks done

Review old security audit #518

jpmckinney opened this issue Jul 17, 2024 · 0 comments
Milestone

Comments

@jpmckinney
Copy link
Contributor

jpmckinney commented Jul 17, 2024

http://www.spect.cl/blog/2015/11/security-audit-scrapyd/ Parenthesized numbers are from blog post.

Note that almost all of these are moot, because anyone with access to the Scrapyd API can use addversion.json and schedule.json to run arbitrary Python code, with the same privileges as the Scrapyd process. Nonetheless:

  • 858c408 Sanitize project name in both API Sanitize project name #421 and egg storage, to prevent FilesystemEggStorage from writing (1) or deleting (3) arbitrary paths
  • 848fc18 HTML escape user-provided values on the Home (5) and Jobs (6) views, to prevent XSS (including project, spider, job ID).
  • d346503 Escape user-provided glob (project parameter) in both listversions.json and/or egg storage, to prevent listing files at arbitrary paths (2).
  • b80dfc8 Sanitize project names, spider names and job IDs, to prevent writing logs and items to arbitrary directories (7).

(4) ("Executing python code when counting spiders") is not a vulnerability, because anyone with access to addversion.json also has access to schedule.json, and can therefore run the same, arbitrary Python code.

Among the other suggestions:

  • Scrapyd binds to localhost by default since 1.2.0.
  • It doesn't enable basic authentication by default, but the option is provided since 1.3.0.
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