race_interference

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 14 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    = "race-interference"
	ModuleName  = "Race Interference Detection"
	ModuleShort = "Detects input storage, cross-contamination, and request interference races"
)

Variables

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

	ModuleConfirmation = "" /* 136-byte string literal not displayed */
	ModuleSeverity     = severity.Medium
	ModuleConfidence   = severity.Firm
	ModuleTags         = []string{"race-condition", "heavy"}
)

Functions

This section is empty.

Types

type Finding

type Finding struct {
	Type        FindingType
	Parameter   string
	Anchor      string
	WrongIdSeen string
	Request     string
	Response    string
}

Finding represents a detected race condition vulnerability.

func (*Finding) Confidence

func (f *Finding) Confidence() severity.Confidence

Confidence returns the per-finding confidence. Request Interference is downgraded to Tentative for the same reason as Severity above.

func (*Finding) Severity

func (f *Finding) Severity() severity.Severity

Severity returns the per-result severity. Wrong-id signals are confined to one scanner identity, so they remain Medium candidates. Divergence alone is informational until a state or authorization impact is shown.

type FindingType

type FindingType int

FindingType represents the type of race condition finding.

const (
	FindingInputStorage FindingType = iota
	FindingCrossContamination
	FindingRequestInterference
)

func (FindingType) String

func (f FindingType) String() string

String returns a human-readable name for the finding type.

type Module

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

Module detects race condition vulnerabilities through parallel request analysis.

func New

func New() *Module

New creates a new race interference detection module.

func (*Module) ScanPerInsertionPoint

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

ScanPerInsertionPoint tests a single insertion point for race condition vulnerabilities.

type Options

type Options struct {
	// EnableInputStorageDetection detects input values persisting across requests (cache poisoning).
	EnableInputStorageDetection bool

	// EnableCrossContaminationDetection detects data from request X appearing in response Y.
	EnableCrossContaminationDetection bool

	// EnableRequestInterferenceDetection detects divergent responses from parallel requests.
	EnableRequestInterferenceDetection bool

	// BaselineRequestCount is the number of sequential requests for establishing baseline.
	BaselineRequestCount int

	// ParallelProbeCount is the number of concurrent requests in the parallel probe phase.
	ParallelProbeCount int

	// ConfirmationRequestCount is the number of sequential requests for confirmation.
	ConfirmationRequestCount int
}

Options configures the race interference scanner behavior.

func DefaultOptions

func DefaultOptions() Options

DefaultOptions returns the default scanner options.

type ProbeResult

type ProbeResult struct {
	Index      int
	UniqueID   string
	Body       string
	StatusCode int
	Headers    map[string][]string
	Request    string
	Response   string
	HasWrongId bool
	WrongIdVal string
	Err        error
}

ProbeResult holds the result of a single probe request.

type ResponseGroup

type ResponseGroup struct {
	// contains filtered or unexported fields
}

ResponseGroup holds a merged fingerprint and associated responses for baseline comparison.

func NewResponseGroup

func NewResponseGroup(statusCode int, body string, headers map[string][]string) *ResponseGroup

NewResponseGroup creates a new ResponseGroup from initial response data.

func (*ResponseGroup) Matches

func (g *ResponseGroup) Matches(statusCode int, body string, headers map[string][]string) bool

Matches checks if a response matches this baseline group.

func (*ResponseGroup) Update

func (g *ResponseGroup) Update(statusCode int, body string, headers map[string][]string)

Update merges another response into the group fingerprint.

Jump to

Keyboard shortcuts

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