Fix crashes found by fuzzing malformed input

- Components can't be made into a parent loop, and the parts tree walks
  stop safely if one exists (logbook entry and squawk resolution pages
  crashed).
- A rejected aircraft photo no longer breaks the edit page; empty photos
  are refused; images that can't be read aren't resized, and a failed
  resize sends the original instead of an error.
- Unsupported formats (/report.pdf…) answer 406; tampered upload
  references, out-of-range numbers and constraint violations get a form
  message instead of a 500; requests with null bytes are refused (400).
- Blank values in required columns with defaults take the default;
  optional links to records that don't exist are validation errors.
- Imports (oil report, logbook scans, .sam.zip) accept only uploaded files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-14 13:17:43 -05:00
1 parent 5876c07a1a
commit 908c943e21
15 files changed
+201 -15

No files matched your search

+1 -1
View File
@@ -8,7 +8,7 @@ module AircraftHelper
current_user.accessible_aircraft.ordered.limit(OFFLINE_AIRCRAFT).map do |a|
{ tail: a.tail_number, pages: [ aircraft_path(a), aircraft_weight_balance_records_path(a) ],
flight: new_aircraft_flight_log_path(a), squawk: new_aircraft_squawk_path(a),
pictures: (%i[thumb card].map { url_for(a.picture_for(_1)) }.uniq if a.picture.attached?) }.compact
pictures: (%i[thumb card].map { url_for(a.picture_for(_1)) }.uniq if a.picture_shown?) }.compact
end
end
# Tabs on the aircraft pages: [label, path, controller names that highlight it, owner_only]