open_redirect

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: MIT Imports: 19 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ModuleID    = "open-redirect"
	ModuleName  = "Open Redirect"
	ModuleShort = "Detects open redirect vulnerabilities"
)

Variables

View Source
var (
	ModuleDesc = `` /* 657-byte string literal not displayed */

	ModuleConfirmation = "Confirmed when injected external URL appears in a redirect Location header or meta refresh tag"
	ModuleSeverity     = severity.Medium
	ModuleConfidence   = severity.Firm
	ModuleTags         = []string{"open-redirect", "moderate"}
)

Functions

func CheckRedirectOutput

func CheckRedirectOutput(respChain *httpUtils.ResponseChain, callback func(nextLoc string) bool)

CheckRedirectOutput invokes callback with each redirect target the response declares — via the Location header, the Refresh header, a <meta> http-equiv refresh/location tag, or a JavaScript location/window redirect. The callback returns true to keep scanning further targets, false to stop early.

func DomainRedirectRegex

func DomainRedirectRegex(domain string) *regexp.Regexp

DomainRedirectRegex returns a regex that matches a redirect target pointing at the given domain, covering the https://, //, /\, /\\ and userinfo-prefixed forms a redirect value can take.

func MatchRedirectParam

func MatchRedirectParam(name, value string) bool

MatchRedirectParam reports whether a parameter — by its name or its current value — looks like a redirect/URL sink worth testing.

Types

type Module

type Module struct {
	modkit.BaseActiveModule
	// contains filtered or unexported fields
}

func New

func New() *Module

func (*Module) ScanPerRequest

func (m *Module) ScanPerRequest(
	ctx *httpmsg.HttpRequestResponse,
	httpClient *http.Requester,
	scanCtx *modkit.ScanContext,
) ([]*output.ResultEvent, error)

func (*Module) VulnClass added in v0.5.3

func (m *Module) VulnClass() string

VulnClass enables cross-module (param, class) dedup: once any open-redirect module reports a parameter, the others in the class skip it.

Jump to

Keyboard shortcuts

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