Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Missing draft detection-strategy name passes dry-run but returns 500 on save

Aperta
#504 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript
Ambito
api, backend, database

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
  1. Start with a valid detection-strategy POST payload.
  2. Remove only stix.name, keeping workspace.workflow.state as work-in-progress.
  3. POST to /api/detection-strategies with 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.name is 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-review validation.

Confirmed through controlled live requests and container logs. The API remained responsive; this failure did not crash the process.

Lingua principale
JavaScript
Stelle
57
Fork
18
Merge medio
1g 26m
PR unite (30g)
7

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di mitre-attack/attack-workbench-rest-api

Tutte le issue di mitre-attack/attack-workbench-rest-api

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.