Running-target scans cannot be authenticated

Ouverte
#65 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
62/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
Active
Stack technique
go
Domaine
security

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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

Langage dominant
Go
Étoiles
0
Forks
1
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Ouvrir dans Codespaces

Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de TMHSDigital/Spackle

Toutes les issues de TMHSDigital/Spackle

Issues similaires

Plus d'issues Go

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.