Running-target scans cannot be authenticated

Abierto
#65 1 comentario 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
62/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
go
Área
security

Línea de trabajo

Start in internal/dast/client.go: read where ClientOptions.Headers is validated and merged in NewClient, then trace the sole caller at internal/engine/live.go:116 to see what it currently sets. Decide on the header source (a [scope] config table or --header flag reading env vars) and thread it through to NewClient, and add the authenticated/unauthenticated run note where crawl results are summarised (internal/dast/crawl.go nearby). Done is when make test and make lint pass, a scoped host's headers reach every request, and the report states whether credentials were sent. Read docs/ARCHITECTURE.md first.

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

Descripción

enhancement severity: low

Summary

The live-target client has a tested option for operator-supplied headers that nothing sets, and no cookie jar, so only the unauthenticated surface is assessed and the report does not say so.

Where

  • internal/dast/client.go:71-72
  • internal/dast/client.go:115-127
  • internal/dast/client.go:129-137
  • internal/engine/live.go:116-118
  • internal/dast/crawl.go:133-135

Details

ClientOptions.Headers is documented as "sent on every request (operator-supplied authentication)" and is validated and merged in NewClient. Its only caller, engine/live.go:116, sets UserAgent and OnRecord and nothing else, and no config key or flag feeds it. The http.Client is built without a Jar, so a Set-Cookie from a login response is recorded and then forgotten. Meanwhile crawl.go:133 skips logout-like links "so it does not end the session it is using".

Impact

The baseline and the endpoint investigator only ever see the unauthenticated surface of the target. Nothing in the run notes says so, so a report on an application that is mostly behind a login reads as coverage of the application. The validated, tested header path is dead code from the product's point of view.

Suggested fix

Either wire it up (a [scope] headers table or --header flag whose values are read from environment variables, masked in exchanges as maskRequestHeaders already does) or remove the option and add a fixed run note: "Requests were sent without credentials; pages behind a login were not examined."

Acceptance criteria

  • Headers can be supplied from the environment for a scoped host
  • The report states whether the scan was authenticated

Getting started

  • Relevant files: internal/dast/client.go, internal/engine/live.go, internal/dast/crawl.go
  • How to run tests: make test (Unix) or .\make.ps1 test (Windows PowerShell); lint with make lint
  • Related docs: CONTRIBUTING.md, AGENTS.md, docs/ARCHITECTURE.md

Filed by repo-audit/full-audit at 35948f7. Severity: low. Effort: M. audit-key: enhancement|internal/dast/client.go|ClientOptions.Headers

Lenguaje dominante
Go
Estrellas
0
Forks
1
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

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 TMHSDigital/Spackle

Todos los issues de TMHSDigital/Spackle

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.