Scanner probes cause MimeNegotiation::InvalidType 500s on the home page: return 4xx instead
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 82/100
Hướng nghiên cứu
Bắt đầu bằng cách đọc trình xử lý unsupported_media_type hiện có trong app/controllers/application_controller.rb, sau đó kiểm tra cách config.action_dispatch.rescue_responses được thiết lập trong config/application.rb. Thêm một request spec cho GET / với tiêu đề Accept sai định dạng và xác nhận rằng nó trả về phản hồi 4xx. Hoàn tất khi spec chạy đạt và kiểu MIME không hợp lệ không còn gây ra lỗi 500.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
Scout APM Errors (7 days to 2026-11-15): ActionDispatch::Http::MimeNegotiation::InvalidType on StaticController#index (the home page). 4 all-time, 1 in the last 7 days, latest 2026-11-10. The message is a path-traversal probe: "../../../../../../../../../../etc/services{{" is not a valid MIME type.
Root cause
This is an automated scanner sending a junk Accept or Content-Type header. Rails raises while reading request.format and returns a 500, which pages us and fills the error list with noise. It is not a vulnerability: Rails rejects the value. It should be a 4xx, not an error.
Suggested fix
- In
ApplicationController, addrescue_from ActionDispatch::Http::MimeNegotiation::InvalidTypewith a handler that doeshead :not_acceptable(406) orhead :bad_request(400). Look at the existingunsupported_media_typehandler inapp/controllers/application_controller.rbfirst; it may be reusable. - Note the exception can be raised before the controller runs (in middleware). If a controller
rescue_fromdoes not catch it in a spec, add the handler as a small Rack middleware or useconfig.action_dispatch.rescue_responses["ActionDispatch::Http::MimeNegotiation::InvalidType"] = :not_acceptableinconfig/application.rb. That one line is the simplest option, try it first. - Add a request spec:
get "/", headers: {"Accept" => "../../etc/passwd{{"}returns 4xx, not 500. - Mark Scout error group 124280 resolved after deploy.
Difficulty: easy. Good first issue.
- Ngôn ngữ chính
- Ruby
- Star
- 384
- Fork
- 558
- Merge trung bình
- 1 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 63
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của rubyforgood/casa
-
Difficulty: Easy Good First Issue Help Wanted ruby Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
rubyforgood/casa#7402 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Remove the bin/bundle binstub (Heroku warns it can break Bundler on deploy)Có thể đã có người làm @Akash-Dhanwate đã nhận 8 ngày trước. Đang mởdependencies Difficulty: Easy Good First Issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
rubyforgood/casa#7325 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Reports page: move export-button disable/re-enable into a Stimulus controllerCó thể làm lại được @Akash-Dhanwate đã nhận 9 ngày trước và không có pull request nào đang mở. Đang mởDifficulty: Easy Good First Issue Help Wanted javascript
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
rubyforgood/casa#7311 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
New case: use Stimulus for the "I don't know the court date yet" toggleCó thể làm lại được @Aryankn29 đã nhận 9 ngày trước và không có pull request nào đang mở. Đang mởDifficulty: Easy Good First Issue Help Wanted javascript
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
rubyforgood/casa#7310 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Case contacts filter: use the auto-submit Stimulus controller instead of jQueryCó thể đã có người làm @Impana-14 đã nhận 7 ngày trước. Đang mởDifficulty: Easy Good First Issue Help Wanted javascript
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
rubyforgood/casa#7309 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của rubyforgood/casa
Issue tương tự
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
internetee/registry#2984 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Redis Lua error `@user_script:52: ERR value is not an integer or out of range` when `window_size` is configuredCó thể đã có người làm @mimosa đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
riscv/riscv-unified-db#2829 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
docker-library/ruby#534 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100