dast

package
v0.4.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package dast holds the active application-testing checks (injection and related classes). It is a SKELETON: the check metadata, modes, standards mapping and remediation are complete, but the actual input-testing logic is left as a stub for you to implement — Scout does not ship attack payloads.

To finish a check, implement its probe method where marked `TODO(you)`. Rules your implementation MUST follow:

  • Send every request through core.HTTPClient(ctx) — never a bare client. That keeps the request inside scope, under the rate limit and scan window, honoring the kill switch, and signed with X-Scout-Scan.
  • Respect the declared Mode(). The engine only runs a check when the environment's cap allows it; active checks additionally require ownership verification on non-local hosts (both already enforced).
  • Use only configured test accounts and non-destructive requests.
  • Discover targets with crawl.Crawl(ctx, t) (pages, forms, endpoints).
  • Return a core.Finding per confirmed issue, with evidence; set Confidence honestly (confirmed only when proven).

Until the stubs are implemented each Run returns no findings. Wire the package into collectors/all only once a check is real.

Index

Constants

This section is empty.

Variables

View Source
var RemediationBusinessLogic = core.Remediation{
	What: "A business workflow trusts client-supplied values instead of enforcing its own rules.",
	Why:  "An attacker manipulates quantities, prices or amounts to get free goods, negative charges or other unintended outcomes.",
	How: []core.Fix{
		{Stack: "generic", Language: "text", Code: "Enforce every invariant server-side (ranges, ownership, totals computed from trusted data), never trust client-sent prices or totals, and add tests for the abuse cases."},
	},
	Effort:     core.EffortL,
	References: []string{"https://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Security_Testing/10-Business_Logic_Testing/README"},
}
View Source
var RemediationCmdInjection = core.Remediation{
	What:       "Untrusted input is passed to an operating-system command.",
	Why:        "An attacker who can influence a shell command can run arbitrary commands on the server.",
	How:        []core.Fix{{Stack: "generic", Language: "text", Code: "Avoid shelling out; call APIs directly. If you must exec, pass arguments as a list (never a shell string), and allowlist values."}},
	Effort:     core.EffortM,
	References: []string{"https://owasp.org/www-community/attacks/Command_Injection"},
}
View Source
var RemediationFileUpload = core.Remediation{
	What: "An upload endpoint does not restrict file type, content, size or storage location.",
	Why:  "An attacker can upload executable or malicious content and, if it is served or executed, take over the server or attack other users.",
	How: []core.Fix{
		{Stack: "generic", Language: "text", Code: "Allowlist content types and extensions, validate the actual content, store uploads outside the web root (or on object storage) with randomized names, serve them with a safe content-type and Content-Disposition, and cap size."},
	},
	Effort:     core.EffortM,
	References: []string{"https://cheatsheetseries.owasp.org/cheatsheets/File_Upload_Cheat_Sheet.html"},
}
View Source
var RemediationOpenRedirect = core.Remediation{
	What:       "A redirect target is taken from user input without validation.",
	Why:        "Attackers use open redirects for convincing phishing and to bypass allowlists in OAuth and SSO flows.",
	How:        []core.Fix{{Stack: "generic", Language: "text", Code: "Redirect only to an allowlist of paths/hosts, or map a server-side key to the destination; never redirect to a raw user-supplied URL."}},
	Effort:     core.EffortS,
	References: []string{"https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html"},
}
View Source
var RemediationPathTraversal = core.Remediation{
	What:       "A file path is built from user input without containment.",
	Why:        "An attacker can read or write files outside the intended directory, such as configuration or secrets.",
	How:        []core.Fix{{Stack: "generic", Language: "text", Code: "Resolve the final path and verify it stays within an allowed base directory; reject '..' and absolute paths; prefer opaque IDs over filenames."}},
	Effort:     core.EffortM,
	References: []string{"https://owasp.org/www-community/attacks/Path_Traversal"},
}
View Source
var RemediationSQLi = core.Remediation{
	What: "Untrusted input reaches a SQL query in a way that lets it change the query's structure.",
	Why:  "An attacker can read, modify or destroy data, bypass authentication, or in some setups run commands on the database host.",
	How: []core.Fix{
		{Stack: "gin", Language: "go", Code: "// Use parameterized queries / prepared statements, never string concatenation.\ndb.Query(\"SELECT * FROM users WHERE id = ?\", id)\n// With an ORM (GORM): db.Where(\"id = ?\", id).First(&u)"},
		{Stack: "generic", Language: "text", Code: "Use parameterized queries everywhere, validate/allowlist input types, and grant the DB account least privilege."},
	},
	Effort:     core.EffortM,
	References: []string{"https://owasp.org/www-community/attacks/SQL_Injection", "https://cheatsheetseries.owasp.org/cheatsheets/SQL_Injection_Prevention_Cheat_Sheet.html"},
}

RemediationSQLi is the fix guidance to attach to app.sqli findings.

View Source
var RemediationSSRF = core.Remediation{
	What:       "The server fetches a URL supplied by the user without restriction.",
	Why:        "An attacker can make the server reach internal services and cloud metadata endpoints it should not, leaking credentials or pivoting inside the network.",
	How:        []core.Fix{{Stack: "generic", Language: "text", Code: "Allowlist destination hosts/schemes, resolve and block private/link-local ranges, disable redirects, and require egress through a proxy."}},
	Effort:     core.EffortL,
	References: []string{"https://owasp.org/www-community/attacks/Server_Side_Request_Forgery"},
}
View Source
var RemediationSSTI = core.Remediation{
	What: "Untrusted input is rendered by a server-side template engine, so it is evaluated as template code.",
	Why:  "An attacker can read server data and, in many engines, achieve remote code execution through template expressions.",
	How: []core.Fix{
		{Stack: "generic", Language: "text", Code: "Never build templates from user input. Pass user data as rendering context/variables to a pre-defined template, and use a sandboxed/logic-less engine where possible."},
	},
	Effort:     core.EffortM,
	References: []string{"https://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Security_Testing/07-Input_Validation_Testing/18-Testing_for_Server-side_Template_Injection"},
}
View Source
var RemediationXSS = core.Remediation{
	What:       "User input is reflected into a response without output encoding.",
	Why:        "An attacker can run script in a victim's browser to steal sessions, make requests as the user, or deface the page.",
	How:        []core.Fix{{Stack: "generic", Language: "text", Code: "Context-encode all output (HTML/attribute/JS/URL), use a strict Content-Security-Policy, and prefer frameworks that auto-escape."}},
	Effort:     core.EffortM,
	References: []string{"https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html"},
}
View Source
var RemediationXXE = core.Remediation{
	What: "An XML parser is configured to resolve external entities and DTDs from untrusted documents.",
	Why:  "An attacker can read local files, perform server-side requests (SSRF), or cause denial of service through entity expansion.",
	How: []core.Fix{
		{Stack: "generic", Language: "text", Code: "Disable DTDs and external entity resolution in the XML parser (the secure default in most modern libraries), or use a data format without entities (JSON) where possible."},
	},
	Effort:     core.EffortM,
	References: []string{"https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html"},
}

Functions

func Checks

func Checks() []core.Check

Checks returns the DAST checks: the six implemented probes plus the scaffold probes (registered, but no-ops until their logic is written).

Types

type BlindSSRF added in v0.4.13

type BlindSSRF struct{}

BlindSSRF confirms server-side request forgery out-of-band: it injects a URL pointing at Scout's own OAST listener into candidate parameters and reports a parameter when the target calls the listener back. It confirms the *blind* case the reflected SSRF check cannot — where the fetched response never returns to the client. Detection only: Scout observes the callback, it does not exploit.

Reachability: the listener must be reachable by the target. For a localhost target it just works; for a remote target, set SCOUT_OOB_ADDR to a base URL the target can reach (e.g. http://your-host:9999), and Scout binds that port.

func (BlindSSRF) ASVS added in v0.4.13

func (BlindSSRF) ASVS() []string

func (BlindSSRF) Category added in v0.4.13

func (BlindSSRF) Category() core.Category

func (BlindSSRF) Description added in v0.4.13

func (BlindSSRF) Description() string

func (BlindSSRF) ID added in v0.4.13

func (BlindSSRF) ID() string

func (BlindSSRF) Mode added in v0.4.13

func (BlindSSRF) Mode() core.Mode

func (BlindSSRF) OWASP added in v0.4.13

func (BlindSSRF) OWASP() []string

func (BlindSSRF) Run added in v0.4.13

func (c BlindSSRF) Run(ctx context.Context, t core.Target) ([]core.Finding, error)

type BusinessLogic

type BusinessLogic struct{}

func (BusinessLogic) ASVS

func (BusinessLogic) ASVS() []string

func (BusinessLogic) Category

func (BusinessLogic) Category() core.Category

func (BusinessLogic) Description

func (BusinessLogic) Description() string

func (BusinessLogic) ID

func (BusinessLogic) ID() string

func (BusinessLogic) Mode

func (BusinessLogic) Mode() core.Mode

func (BusinessLogic) OWASP

func (BusinessLogic) OWASP() []string

func (BusinessLogic) Run

type CommandInjection

type CommandInjection struct{}

func (CommandInjection) ASVS

func (CommandInjection) ASVS() []string

func (CommandInjection) Category

func (CommandInjection) Category() core.Category

func (CommandInjection) Description

func (CommandInjection) Description() string

func (CommandInjection) ID

func (CommandInjection) ID() string

func (CommandInjection) Mode

func (CommandInjection) Mode() core.Mode

func (CommandInjection) OWASP

func (CommandInjection) OWASP() []string

func (CommandInjection) Run

type FileUpload

type FileUpload struct{}

func (FileUpload) ASVS

func (FileUpload) ASVS() []string

func (FileUpload) Category

func (FileUpload) Category() core.Category

func (FileUpload) Description

func (FileUpload) Description() string

func (FileUpload) ID

func (FileUpload) ID() string

func (FileUpload) Mode

func (FileUpload) Mode() core.Mode

func (FileUpload) OWASP

func (FileUpload) OWASP() []string

func (FileUpload) Run

func (c FileUpload) Run(ctx context.Context, t core.Target) ([]core.Finding, error)

type OpenRedirect

type OpenRedirect struct{}

func (OpenRedirect) Category

func (OpenRedirect) Category() core.Category

func (OpenRedirect) Description

func (OpenRedirect) Description() string

func (OpenRedirect) ID

func (OpenRedirect) ID() string

func (OpenRedirect) Mode

func (OpenRedirect) Mode() core.Mode

func (OpenRedirect) OWASP

func (OpenRedirect) OWASP() []string

func (OpenRedirect) Run

func (c OpenRedirect) Run(ctx context.Context, t core.Target) ([]core.Finding, error)

type PathTraversal

type PathTraversal struct{}

func (PathTraversal) ASVS

func (PathTraversal) ASVS() []string

func (PathTraversal) Category

func (PathTraversal) Category() core.Category

func (PathTraversal) Description

func (PathTraversal) Description() string

func (PathTraversal) ID

func (PathTraversal) ID() string

func (PathTraversal) Mode

func (PathTraversal) Mode() core.Mode

func (PathTraversal) OWASP

func (PathTraversal) OWASP() []string

func (PathTraversal) Run

type ReflectedXSS

type ReflectedXSS struct{}

func (ReflectedXSS) ASVS

func (ReflectedXSS) ASVS() []string

func (ReflectedXSS) Category

func (ReflectedXSS) Category() core.Category

func (ReflectedXSS) Description

func (ReflectedXSS) Description() string

func (ReflectedXSS) ID

func (ReflectedXSS) ID() string

func (ReflectedXSS) Mode

func (ReflectedXSS) Mode() core.Mode

func (ReflectedXSS) OWASP

func (ReflectedXSS) OWASP() []string

func (ReflectedXSS) Run

func (c ReflectedXSS) Run(ctx context.Context, t core.Target) ([]core.Finding, error)

type SQLi

type SQLi struct{}

func (SQLi) ASVS

func (SQLi) ASVS() []string

func (SQLi) Category

func (SQLi) Category() core.Category

func (SQLi) Description

func (SQLi) Description() string

func (SQLi) ID

func (SQLi) ID() string

func (SQLi) Mode

func (SQLi) Mode() core.Mode

func (SQLi) OWASP

func (SQLi) OWASP() []string

func (SQLi) Run

func (c SQLi) Run(ctx context.Context, t core.Target) ([]core.Finding, error)

type SSRF

type SSRF struct{}

func (SSRF) ASVS

func (SSRF) ASVS() []string

func (SSRF) Category

func (SSRF) Category() core.Category

func (SSRF) Description

func (SSRF) Description() string

func (SSRF) ID

func (SSRF) ID() string

func (SSRF) Mode

func (SSRF) Mode() core.Mode

func (SSRF) OWASP

func (SSRF) OWASP() []string

func (SSRF) Run

func (c SSRF) Run(ctx context.Context, t core.Target) ([]core.Finding, error)

type SSTI

type SSTI struct{}

func (SSTI) ASVS

func (SSTI) ASVS() []string

func (SSTI) Category

func (SSTI) Category() core.Category

func (SSTI) Description

func (SSTI) Description() string

func (SSTI) ID

func (SSTI) ID() string

func (SSTI) Mode

func (SSTI) Mode() core.Mode

func (SSTI) OWASP

func (SSTI) OWASP() []string

func (SSTI) Run

func (c SSTI) Run(ctx context.Context, t core.Target) ([]core.Finding, error)

type XXE

type XXE struct{}

func (XXE) ASVS

func (XXE) ASVS() []string

func (XXE) Category

func (XXE) Category() core.Category

func (XXE) Description

func (XXE) Description() string

func (XXE) ID

func (XXE) ID() string

func (XXE) Mode

func (XXE) Mode() core.Mode

func (XXE) OWASP

func (XXE) OWASP() []string

func (XXE) Run

func (c XXE) Run(ctx context.Context, t core.Target) ([]core.Finding, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL