Missing draft detection-strategy name passes dry-run but returns 500 on save
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript
Hướng nghiên cứu
Start at the POST /api/detection-strategies entry point and trace how dry-run and save requests apply ADM draft validation before reaching the Mongoose model. Reproduce the missing stix.name cases with both dry-run values and awaiting-review, then add regression coverage. Done means consistent validation and an HTTP 400 response instead of a save-time HTTP 500.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
A draft detection strategy without stix.name passes dry-run validation but returns HTTP 500 when saved.
Affected version: REST API 4.24.0, commit 69b37fe769e6abe7675d413451a8361aecc36bea.
Reproduction
- Start with a valid detection-strategy POST payload.
- Remove only
stix.name, keepingworkspace.workflow.stateaswork-in-progress. - POST to
/api/detection-strategieswith the following variations:
| Request | Actual result |
|---|---|
?dryRun=true |
200 |
?dryRun=false |
500 |
Same missing-name payload with state awaiting-review |
400 |
REST API logs show:
Detection-Strategy validation failed: stix.name: Path
stix.nameis required.
Apparent cause
Draft ADM validation uses a partial schema that permits an omitted name. The Mongoose detection-strategy model requires name regardless of workflow state.
Saving fails Mongoose validation, which the repository wraps as DatabaseError and translates to HTTP 500.
Expected behavior
Draft validation, persistence, and dry-run should agree on required fields. Either support nameless drafts consistently or reject them with HTTP 400 before saving.
Suggested fix
- Align ADM draft validation and Mongoose name requirements.
- Return HTTP 400 for input validation failures.
- Add regression coverage for missing-name drafts with both dry-run values and for
awaiting-reviewvalidation.
Confirmed through controlled live requests and container logs. The API remained responsive; this failure did not crash the process.
- Ngôn ngữ chính
- JavaScript
- Star
- 56
- Fork
- 18
- Merge trung bình
- 21 giờ 14 phút
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không 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 mitre-attack/attack-workbench-rest-api
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
mitre-attack/attack-workbench-rest-api#513 ·
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 86/100
mitre-attack/attack-workbench-rest-api#505 ·
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 86/100
mitre-attack/attack-workbench-rest-api#499 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add ADM validation bypass for server-controlled fields on non-compliant objectsCó thể đã có người làm @seansica đã nhận 13 ngày trước. Đang mở
mitre-attack/attack-workbench-rest-api#517 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 74/100
mitre-attack/attack-workbench-rest-api#512 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của mitre-attack/attack-workbench-rest-api
Issue tương tự
-
self-driving
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
kind:bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
status: needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
mastra-ai/mastra#28500 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
fossasia/scrum_helper#949 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Foundryborne/daggerheart#2531 ·
Maintainer thường phản hồi trong vòng 1 ngày