agentleFS
awarexoneawarexone/AXguard/session-security/SKILL.md

session-security

Skill18 starsChanged 3 months agoMITView on GitHub

Analyze session management security — use when reviewing cookie flags, session fixation, timeout, logout, concurrent sessions, or server-side session stores (A07:2021 / CWE-287 / CWE-352 adjacency).

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    After finding XSS near session cookies (theft impact) or auth.disable-csrf style hits.

    line 43
  2. Very specific:

    Check cookie attributes and scope (Domain/Path least privilege).

    line 66
  3. Distinctive:

    Verify logout destroys server session and clears cookies.

    line 69

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Session Security

Purpose

Guide review of session management: how authenticated state is established, stored, protected in transit/browser, rotated, and invalidated.

When to Use / When Not to Use

Use when:

  • Cookie sessions, server session stores, “remember me,” logout flows, or CSRF on cookie-authenticated state-changing requests.
  • After finding XSS near session cookies (theft impact) or auth.disable-csrf style hits.

Do not use when:

  • Pure bearer JWT APIs with no cookies (use jwt-security; still consider token storage on clients).
  • AuthZ object checks unrelated to session lifecycle (authorization-analysis).

Security Concepts

A session ID is a bearer capability. It needs entropy, TLS, cookie flags (Secure, HttpOnly, SameSite), rotation at login, and server-side invalidation at logout. CSRF matters when cookies authenticate browsers automatically.

Threat Model

Attacker goals:

  1. Steal or fixate session IDs → account takeover.
  2. CSRF state-changing actions as the victim.
  3. Prolong access via non-expiring sessions / missing logout.
  4. Session confusion across privilege changes (login as user A then B without rotate).

Analysis Workflow

  1. Identify session mechanism (cookie SID, server store, signed cookie).
  2. Check cookie attributes and scope (Domain/Path least privilege).
  3. Confirm regeneration of session ID on login and privilege elevation.
  4. Review idle/absolute timeouts and remember-me token design.
  5. Verify logout destroys server session and clears cookies.
  6. For cookie auth: CSRF tokens / SameSite / double-submit patterns on mutating routes.
  7. Assess XSS impact if HttpOnly missing; bind with xss-analysis.

Evidence Requirements

  • Session config / middleware location
  • Missing flag, rotation, timeout, or CSRF control
  • Impact on account takeover or forged actions

False Positive Controls

  • Bearer-header APIs without cookie auth (CSRF N/A for classic cookie CSRF)
  • SameSite=Strict with no cross-site needs and verified behavior
  • Short-lived sessions with robust rotation already present

Remediation

  1. Set Secure, HttpOnly, and appropriate SameSite; use __Host- prefix when possible.
  2. Rotate session IDs on login; invalidate on logout/password change.
  3. Enforce timeouts; bind sessions to user agent risk signals as needed.
  4. Protect mutating cookie-auth routes against CSRF.
  5. Store minimal data server-side; never put privileges only in forgeable client state.

Verification

Review cookie/session lifecycle → Fix flags/rotation/CSRF → Re-run axguard → Confirm logout invalidates server state

Related Skills

  • authentication-analysis, jwt-security, oauth-security
  • websocket-security, xss-analysis
  • security-triage, security-remediation

Framework Mapping

  • CWE-287, CWE-352
  • OWASP A07:2021
  • OWASP API2:2023 Broken Authentication

References

Research Provenance

Primary sources:

  • OWASP A07:2021; OWASP API2:2023; CWE-287; CWE-352 (accessed 2026-09-15)

Secondary / internal:

  • AXGuard rules/auth.json (CSRF disable patterns), /axguard-auth
  • AwareXone Agentic-Bug-Hunter session methodology (concepts only; not copied)

Datasets:

  • UVID HF dataset — category linkage concepts only (MIT license metadata review 2026-09-15)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.