Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#504 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
68/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
javascript
Área
api, backend, database

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
JavaScript
Estrellas
57
Forks
18
Merge medio
1 d 26 min
PR fusionados (30 d)
7

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de mitre-attack/attack-workbench-rest-api

Todos los issues de mitre-attack/attack-workbench-rest-api

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.