Bug: court report .docx download is blocked with a "virus detected" warning in Edge on Windows
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ó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Bắt đầu bằng việc kiểm thử lại báo cáo tòa án đã tạo sau khi #7098 được phát hành, sử dụng Windows và Edge, sau đó kiểm tra app/controllers/case_court_reports_controller.rb:22 và manh mối từ #7099. So sánh các tệp tải xuống từ các template default và Montgomery, kiểm tra xem còn sót lại các phần mã trường hay không. Được xem là hoàn tất khi tệp .docx được tải xuống mà không có cảnh báo từ phần mềm diệt virus hoặc SmartScreen và xác định được điều kiện gây ra vấn đề.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Reported by Voices for Children Montgomery in the 2026-08-07 stakeholder sync. Distinct from #7093 — see "Not the same bug as #7093" below.
Impacted User Types
- volunteers, case supervisors, and org staff at the reporting org — multiple people, not one machine
Environment
prod. Microsoft Edge on Windows. Downloading a generated court report .docx.
Current Behavior
Generating a court report succeeds, but the browser download is blocked with a "virus detected" warning. The user has to go into their antivirus software and tell it to ignore the detection to download anyway.
Stakeholder's words, from the sync:
Every time I download a report and other people download a report, it says viruses are detected. And then I have to go into like the virus detection software to say to ignore the virus and download anyway … which is kind of obnoxious and that's been happening for a while [approximately six months].
[!NOTE]
Screenshot pending. A redacted screenshot of the Edge warning was captured during the sync and will be attached to this issue.
Expected Behavior
The generated .docx downloads without any antivirus or SmartScreen warning.
Not the same bug as #7093
#7093 was "the file isn't in the correct format" when opening the report in Word, root-caused to zip64 (#7098, shipped 2026-08-06). This one fires earlier — at download time, in the browser, before Word is involved — and the stakeholder dates it to roughly six months, whereas the zip64 regression only started when the caxlsx bump floated us to rubyzip 3.x in April 2026.
That said, #7098 shipped the day before this was reported, so step one is re-testing: a structurally odd zip (version-needed 45, 0xFFFFFFFF size placeholders) is exactly the sort of thing antivirus heuristics dislike, so the fix may have taken this with it.
Leads, cheapest first
1. The download has no explicit filename — see #7099. CaseCourtReportsController#show (app/controllers/case_court_reports_controller.rb:22):
@casa_case.latest_court_report.open do |file|
# TODO test this .read being present, we've broken it twice now
send_data File.read(file.path), type: :docx, disposition: "attachment", status: :ok
end
There is no filename:, so the browser derives the download name from the URL path. #7093 produced a file named _C-15-JV-24-191.docx — leading underscore, not in the case number. A binary attachment with a browser-derived name, served from a Heroku app domain with no SmartScreen reputation, is a good match for the heuristic profile. Fixing #7099 (File.binread + explicit filename:) is the cheapest thing to try and is worth doing regardless.
2. Field codes left in the generated document. The org templates are full of Word MERGEFIELD … \* MERGEFORMAT field instructions — visible in the raw XML of default_report_template.docx, and heavily throughout montgomery_report_template.docx (the reporting org's own template). Sablon substitutes the «…» text but the surrounding field-code machinery stays in the package. A .docx carrying field codes is a classic malware-delivery shape (DDEAUTO / INCLUDEPICTURE), and Defender is aggressive about it. Hypothesis, not verified — worth checking whether the generated output retains field-code remnants, and whether a template stripped of MERGEFIELD instructions downloads cleanly.
3. Ruled out. Content-Type is registered correctly — config/initializers/mime_types.rb maps :docx to application/vnd.openxmlformats-officedocument.wordprocessingml.document, so this is not a mismatched-type warning. Byte-exactness was verified during #7093/#7099 (Content-Length correct, download byte-identical to the stored blob), so it is not truncation in transit.
Info still needed from the stakeholder
- Does it still happen now that #7098 has shipped (2026-08-06)?
- Which antivirus is producing the warning — Windows Defender, or a third-party product?
- Does Chrome or Firefox on the same machine warn too? (Separates the Edge/SmartScreen path from the AV engine itself.)
- Does it happen for every org template, or only Montgomery's?
How to Replicate
Not reproducible on macOS or Linux — needs Windows + Edge, and ideally the org's real template rather than the default one (real templates from #6601's comments: prince_george_report_template.docx, montgomery_report_template.docx).
- Sign in as
[email protected]/12345678on a Windows machine using Edge. - Open a case with at least one case contact → Generate court report → pick a date range → Generate report.
- Click the resulting download link.
- Observe the "virus detected" warning instead of a clean download.
How to access the QA site
Login Details:
Link to QA site
Login Emails:
- [email protected] view site as a volunteer
- [email protected] view site as a supervisor
- [email protected] view site as an admin
- [email protected] view site as an all casa admin
- go to
/all_casa_admins/sign_in
- go to
password for all users: 12345678
Questions? Join Slack!
We highly recommend that you join us in slack #casa channel to ask questions quickly. And discord for office hours (currently Tuesday 5-7pm Pacific), stakeholder news, and upcoming new issues.
- Ngôn ngữ chính
- Ruby
- Star
- 382
- Fork
- 546
- Merge trung bình
- 3 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 9
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
-
Bug: Reassigned cases are listed under "Not Assigned" in the Assign a new case dropdownCó thể đã có người làm @Anandb71 đã nhận 5 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
rubyforgood/casa#7241 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
💡 Add a code-review agent skillĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
rubyforgood/casa#7227 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
rubyforgood/casa#7218 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Speed up the RSpec suite: parallelize CI, then shrink the JS system-spec sliceCó thể làm lại được @Sufiyan-MSA đã nhận 45 ngày trước và không có pull request nào đang mở. Đang mở📈 Performance Improvement 🧪 Tests
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
rubyforgood/casa#7173 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Include the org in CASA case URLs and finish the switch away from database idsCó thể làm lại được @A-RYAN-1 đã nhận 25 ngày trước và không có pull request nào đang mở. Đang mở✨ New Feature Help Wanted
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 32/100
rubyforgood/casa#7106 · 1 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ự
-
triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
rubyaustralia/ruby_au#497 ·
-
ConcurrencyClaim sends NOTIFY even when enable_listen_notify is falseCó thể đã có người làm @eidam đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
bensheldon/good_job#1891 ·
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 74/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 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
TheOdinProject/curriculum#31493 ·
Maintainer thường phản hồi trong vòng 1 ngày