Back to Hermes Agent

Vulnerability Taxonomy

optional-skills/security/web-pentest/references/vuln-taxonomy.md

2026.6.54.3 KB
Original Source

Vulnerability Taxonomy

Two classification systems used during analysis. Both come from Shannon (concepts only; rewritten here). Both exist to make the question "is this exploitable?" mechanical instead of vibes-based.

Injection: Slot Types

Every injection sink has a slot type — the lexical position the attacker payload lands in. Each slot type has a small set of required defenses. A mismatch is a vulnerability. The same defense applied to the wrong slot is also a vulnerability.

SlotExampleRequired defense
SQL-valSELECT * FROM u WHERE id = :vParameterized binding
SQL-identSELECT * FROM ${table}Allowlist on identifier values
SQL-keywordORDER BY ${col} ${dir}Allowlist on column AND direction
CMD-argumentsubprocess.run(["ls", v])argv list (never shell=True)
CMD-shellos.system("ls " + v)DON'T — refactor to argv list
PATH-segmentopen("/data/" + v)Normalize + allowlist + base-relative check
URL-hostredirect to https://${v}/xAllowlist of acceptable hosts
URL-fetchrequests.get(v)Allowlist + block private/metadata IPs (SSRF)
TEMPLATE-stringTemplate("Hello {{ v }}")Autoescape ON, no user-controlled template syntax
DESERIALIZE-picklepickle.loads(v)DON'T — use JSON / msgpack
DESERIALIZE-yamlyaml.load(v)yaml.safe_load, never yaml.load
XPATH-exprtree.xpath("//u[@id='" + v + "']")Parameterized XPath or escape
LDAP-filter(uid=${v})LDAP filter escaping
REGEX-patternre.search(v, text)Don't take pattern from user (ReDoS too)
LOG-recordlog.info("got " + v)Encode CR/LF/control chars before logging
EMAIL-headerSubject: ${v}Reject CR/LF
HTTP-headerSet-Cookie: ${v}Reject CR/LF (response splitting)

When you classify a finding:

  1. Identify the slot type
  2. Identify the actual defense in the code (if you have source)
  3. If defense doesn't match the required-defense set: vulnerable

XSS: Render Contexts

XSS exploitability depends on where in the HTML/JS the value lands. Encoding for one context doesn't protect another.

ContextExampleRequired encoding
HTML_BODY<div>{{ v }}</div>HTML entity encode <>&"'
HTML_ATTR_QUOTED<a href="{{ v }}">HTML attr encode
HTML_ATTR_UNQUOTED<a href={{ v }}>Almost impossible to safely encode; quote the attr
URL_ATTR (href/src)<a href="{{ v }}">Validate scheme allowlist + attr encode
JAVASCRIPT_STRING<script>var x = "{{ v }}";</script>JS string escape + ensure quote consistency
JAVASCRIPT_BLOCK<script>{{ v }}</script>DON'T — refactor; no safe encoding
CSS_VALUE<style>color: {{ v }};</style>CSS encode + allowlist scheme/format
CSS_BLOCK<style>{{ v }}</style>DON'T — refactor
JSON_RESPONSE (consumed by JS)JSON.parse(response)JSON encode + correct content-type header
EVENT_HANDLER<div onclick="{{ v }}">JS string escape inside HTML attr encode
URL_PATH (router-driven)route param echoed unencodedURL-encode + HTML-encode
DOM_INNERHTMLel.innerHTML = v (DOM XSS)Use textContent instead, or DOMPurify
DOM_DOC_WRITEdocument.write(v)DON'T — refactor

When you classify:

  1. Identify the render context where user input lands
  2. Identify the encoding applied
  3. Mismatch = vulnerable. Even "HTML encoded" output in JAVASCRIPT_STRING is exploitable (</script><script> evasion).

OWASP Top 10 (2021) Mapping

For reporting:

OWASPSlot/context covered
A01 Broken Access Controlauthz class (IDOR, vertical/horizontal)
A02 Cryptographic Failuresinfra class (weak TLS, plaintext storage)
A03 Injectioninjection class (all slot types except deserialize)
A04 Insecure Designreported in findings narrative
A05 Security Misconfigurationinfra class
A06 Vulnerable Componentsinfra class (whatweb output)
A07 Auth Failuresauth class
A08 Software/Data IntegrityDESERIALIZE-* slots, also supply chain
A09 Logging/Monitoringinfra class (out of scope for active testing)
A10 SSRFssrf class