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 ¶
- Variables
- func Checks() []core.Check
- type BlindSSRF
- type BusinessLogic
- func (BusinessLogic) ASVS() []string
- func (BusinessLogic) Category() core.Category
- func (BusinessLogic) Description() string
- func (BusinessLogic) ID() string
- func (BusinessLogic) Mode() core.Mode
- func (BusinessLogic) OWASP() []string
- func (c BusinessLogic) Run(ctx context.Context, t core.Target) ([]core.Finding, error)
- type CommandInjection
- func (CommandInjection) ASVS() []string
- func (CommandInjection) Category() core.Category
- func (CommandInjection) Description() string
- func (CommandInjection) ID() string
- func (CommandInjection) Mode() core.Mode
- func (CommandInjection) OWASP() []string
- func (c CommandInjection) Run(ctx context.Context, t core.Target) ([]core.Finding, error)
- type FileUpload
- type OpenRedirect
- type PathTraversal
- func (PathTraversal) ASVS() []string
- func (PathTraversal) Category() core.Category
- func (PathTraversal) Description() string
- func (PathTraversal) ID() string
- func (PathTraversal) Mode() core.Mode
- func (PathTraversal) OWASP() []string
- func (c PathTraversal) Run(ctx context.Context, t core.Target) ([]core.Finding, error)
- type ReflectedXSS
- func (ReflectedXSS) ASVS() []string
- func (ReflectedXSS) Category() core.Category
- func (ReflectedXSS) Description() string
- func (ReflectedXSS) ID() string
- func (ReflectedXSS) Mode() core.Mode
- func (ReflectedXSS) OWASP() []string
- func (c ReflectedXSS) Run(ctx context.Context, t core.Target) ([]core.Finding, error)
- type SQLi
- type SSRF
- type SSTI
- type XXE
Constants ¶
This section is empty.
Variables ¶
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"}, }
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"}, }
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"}, }
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"}, }
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"}, }
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.
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"}, }
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"}, }
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"}, }
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 ¶
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) Description ¶ added in v0.4.13
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
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
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
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
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
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