Skip to main content
Vigolium supports multi-session authenticated scanning via the --auth and --auth-file flags. This enables scanning behind login walls and detecting authorization bypass vulnerabilities (IDOR/BOLA).
The --auth / --auth-file flags were previously named --session / --session-file, and a single bundle file holding multiple sessions used the separate --auth-config flag. The old names still work as deprecated aliases (--session--auth, --session-file--auth-file), and --auth-file now also accepts the multi-session sessions: bundle that used to require --auth-config. Update your commands to the new names.
Session config files can be written in YAML or JSON, the format is auto-detected by file extension (.json) or by content sniffing (leading { or [).
Separate from configured sessions, the browser crawler can also try a short list of common default credentials (admin:admin, …) against a confirmed local login form during spidering, so the crawl reaches authenticated areas without an --auth session. It’s off by default and auto-enabled at balanced/deep intensity, negative-control gated, and never a brute-force. See Default-credential login attempts.
When --spider runs, any session the browser establishes — cookies from a cleared WAF/bot challenge plus its User-Agent — is carried forward into the discovery and scanning phases (per host), so later probes reuse the cleared session. It’s on by default; disable with --no-carry-browser-session, and your own -H/--header overrides always win. See Session carry-forward.

Quick Start

Authentication Flags

Both flags can be combined. If no session is explicitly marked as primary, the first session loaded is used as the primary.

Session Roles

Each session has a role that determines how it is used during the scan:
  • primary: The main session. Used for discovery, spidering, and as the default requester during the audit phase. There should be exactly one primary session.
  • compare: Comparison sessions for IDOR/BOLA testing. During the audit phase, every request made by the primary session is replayed with each compare session’s credentials. If a compare session can access resources it shouldn’t, the authz-compare module flags it.

Inline Sessions

The --auth flag accepts sessions in name:Header:value format:
Values containing colons are handled correctly, only the first two colons are used as delimiters.

Session Files

For sessions with multiple headers or login flows, use files. Both YAML and JSON formats are supported.

Static Headers

YAML:
JSON:
Use with:
Session files are resolved from the configured session_dir (default ~/.vigolium/sessions/) if the path is not absolute. See Session Strategy Configuration below.

Login Flows

Session files can define automated login flows. The scanner executes the login request at scan start and extracts credentials from the response. YAML:
JSON:

Extraction Sources

The apply_as field defines how the extracted value is applied as a request header. Use {value} as a placeholder.

Multi-Session Bundle File

A bundle file defines all sessions in one place under a sessions key, and is loaded with --auth-file (this is what the removed --auth-config flag used to do).

YAML Format

JSON Format

Use with:

When to Use JSON

JSON is a good choice when:
  • AI agents generate session configs: most LLMs produce cleaner JSON than YAML, and agent modes (swarm, autopilot) already output session config as JSON natively.
  • Programmatic generation: scripts, CI pipelines, or tools that build session configs are often simpler in JSON.
  • Embedding in other JSON payloads: e.g., the REST API POST /api/agent/run/swarm body includes session config as a nested JSON object.
YAML remains convenient for hand-written configs where comments and multi-line strings help readability.

Format Detection

The format is detected automatically:
  1. File extension: .json files are parsed as JSON; .yaml / .yml as YAML.
  2. Content sniffing: if the extension is ambiguous (or missing), content starting with { or [ (after whitespace trimming) is parsed as JSON.
  3. Fallback: everything else is parsed as YAML.
This means extensionless files work too, pipe JSON directly and it will be detected:

Session Config Schema Reference

Both YAML and JSON use the same field names. Here is the full schema:
Only one of headers, login, or login_request can be set per session.

Managing Sessions with the auth Command

The --auth/--auth-file flags load sessions for a single scan. The vigolium auth subcommand manages reusable, persisted sessions and provides helpers for validating configs and automating 2FA.

List stored sessions

Each row shows hostname, session name, role (primary/compare), position, a token preview, and extract rules. Sessions are scoped to the active project.

Load sessions into the database

auth load persists sessions so subsequent scans pick them up automatically. It accepts a native config file, an agent-produced session-config.json, stdin, or even a raw HTTP login request (which it sends, then auto-discovers tokens from the JSON body, Set-Cookie, and auth headers):
By default, load executes each login flow once to verify the credentials work; pass --no-validate to skip. Agent format is auto-detected when the path contains agent-sessions/ (or force it with --agent-format). The hostname is derived from the first login URL when --host is omitted.

Lint a session config

Catch mistakes before a scan — missing/invalid fields, bad extract rules, unknown login or extract types, multiple primary sessions, or duplicate names:

Generate a TOTP code for 2FA

For automating two-factor login flows, auth totp turns a base32 secret into the current code (JSON output, {"code": "...", "expires_in": <seconds>}):

Environment Variables

Session files (both YAML and JSON) support ${VAR} syntax for secrets. This keeps credentials out of config files:
All ${VAR} references are expanded from the environment at load time, before format parsing.

IDOR/BOLA Testing

To test for authorization bypass vulnerabilities, define at least two sessions, one primary and one or more compare sessions. YAML:
JSON:
The built-in authz-compare module automatically activates when compare sessions are present. It replays primary session requests with compare session credentials and flags responses that indicate broken access control.

How Detection Works

  1. The primary session makes a request and gets a response (e.g., GET /api/users/42 -> 200 OK with user data).
  2. The same request is replayed with each compare session’s credentials.
  3. If a compare session also receives a successful response with similar content, the module reports a potential IDOR/BOLA finding with High severity.

Filtering to Auth Modules Only

To run only authorization testing without other active modules:

How Sessions Affect Scan Phases

Session Strategy Configuration

Session behavior is configured under scanning_strategy.session in vigolium-configs.yaml (see public/vigolium-configs.example.yaml for the full annotated example).

Field Reference

Session Directory Resolution

When --auth-file receives a bare name (no path separators), the scanner resolves it from session_dir. Extensions are tried in order: .yaml, .yml, .json.
If the bare name has no matching file with any extension, .yaml is appended as the default. Absolute paths and relative paths with directory separators (e.g. ./sessions/myapp.json) bypass session_dir and are used as-is. To change the lookup directory:

Common Patterns

Unauthenticated discovery, authenticated scanning:
Crawls the public-facing site first, then applies session headers only during the audit phase. This is useful when you want to see what an unauthenticated attacker can discover before testing the authenticated surface. Authenticated scanning without IDOR testing:
Useful when you only need to scan behind a login wall but don’t have multiple user roles to compare. The primary session’s credentials are applied to all phases, but no compare requesters are created and the authz-compare module stays inactive. Long-running scan with token refresh:
Re-executes login flows every 30 minutes proactively, and also reactively when a 401 or 403 is received. The validate_url confirms credentials work after each login before resuming scanning. Team shared sessions directory:
Point all team members to a shared directory so --auth-file staging-admin resolves the same file for everyone. Scanning profiles (~/.vigolium/profiles/) can also override session strategy values, useful for having a “quick unauthenticated” profile alongside a “deep authenticated” profile.

Using Session Config with Agent Modes

Agent modes (swarm, autopilot) can auto-generate session configs from source code analysis. The generated configs are always written as JSON to the session directory. When running agent swarm with --source, the source-analysis phase discovers authentication flows in the codebase and produces a session-config.json and auth-config.yaml in the session directory. This config is then fed into subsequent scan phases automatically. Swarm accepts a pre-built bundle via its own --auth-config flag (it skips browser/CLI auth synthesis and uses the file verbatim). Autopilot does not take a pre-built file. For both autopilot and swarm, put credentials, roles, login URL, and browser requirements in --prompt (or the positional prompt); browser tooling is always available and the intent parser extracts the auth signals:
The REST agent endpoints still accept structured credentials, credential_sets, auth_required, requires_browser, browser_start_url, and focus_routes fields. Their removal applies to the autopilot/swarm CLI flags only.

Examples

Scan a REST API with Bearer Token

Full IDOR Test with Login Automation (YAML)

Full IDOR Test with Login Automation (JSON)

Combine with Other Scan Options

Auth flags work with all other scan options:

One-Liner JSON Auth Config

For quick testing or CI scripts, you can write a JSON config inline:

Agent-Generated Session Config

When an AI agent discovers auth flows in source code, it produces JSON like:
This can be saved and reused across scans: