Skip to content

Figures

Every diagram type the blog uses, each drawn from a real post. Green is the normal path, red is the flaw, gold is the fix.

To add one to a post, put its data in src/data/viz/<post>.yml under an id, then write this line on its own in the post:

{% include viz.html post="<post>" id="<id>" %}

Map type: map

A system drawn as zones, boxes and arrows. Tabs recolour it: how it works, where it breaks, how it is fixed. Arrows can be cut. Use it for trust boundaries and data paths.

From Attacking AWS CloudTrail 101

Three views: how events are recorded, what the five permissions in the post do to that path, and the guardrails. Click any box for details.
Show the data
flow:
  type: map
  title: Where CloudTrail events go, and what each permission in the post can cut
  kind: Logging path
  caption: >-
    Three views: how events are recorded, what the five permissions in the post do to that path, and
    the guardrails. Click any box for details.
  zones:
    - id: src
      name: Sources
    - id: ct
      name: CloudTrail
    - id: soc
      name: Defenders
  nodes:
    - id: api
      name: AWS API calls
      sub: users, roles, services
      zone: src
      col: 0
      row: 0
      text: Every action taken by a user, a role or an AWS service is recorded as a CloudTrail event.
    - id: ext
      name: Outside source
      sub: e.g. CrowdStrike Falcon
      zone: src
      col: 0
      row: 2
      text: A partner or your own app that sends its events into CloudTrail Lake through a channel.
    - id: ct
      name: CloudTrail
      sub: records events
      zone: ct
      col: 1
      row: 0
      text: The service that records events and delivers them to trails and event data stores.
    - id: chan
      name: Channel
      sub: integration
      zone: ct
      col: 1
      row: 2
      text: >-
        Carries events from an outside source into an event data store. Listed with `aws cloudtrail
        list-channels`.
    - id: trail
      name: Trail + Insights
      sub: unusual-activity events
      zone: ct
      col: 2
      row: 0
      text: >-
        A trail with Insights selectors raises Insights events when API call volume or error rates
        look unusual. Read with `aws cloudtrail get-insight-selectors`.
    - id: eds
      name: Event data store
      sub: CloudTrail Lake
      zone: ct
      col: 2
      row: 2
      text: Stores events for querying. Listed with `aws cloudtrail list-event-data-stores`.
    - id: soc
      name: Detection
      sub: queries and alerts
      zone: soc
      col: 3
      row: 1
      text: 'Whoever reads the logs: a SIEM, an alert rule, an investigator.'
  edges:
    - from: api
      to: ct
    - from: ct
      to: trail
    - from: ct
      to: eds
    - from: ext
      to: chan
    - from: chan
      to: eds
    - from: trail
      to: soc
    - from: eds
      to: soc
  modes:
    - name: How it records
      title: Two paths into the logs
      text: >-
        AWS activity goes through CloudTrail to trails and event data stores. Events from outside
        tools come in through channels into an event data store. Defenders read both.
    - name: What each permission cuts
      tone: bad
      title: Five permissions, five blind spots
      text: >-
        Each permission from the post either cuts an arrow or fills the store with events that never
        happened. Click a red box to see which permission and what is lost.
      nodes:
        chan:
          tone: bad
          note: DeleteChannel
          text: >-
            `cloudtrail:DeleteChannel` removes the integration. Events from that tool stop reaching
            the event data store.
        ext:
          tone: bad
          note: PutAuditEvents
          text: >-
            `cloudtrail-data:PutAuditEvents` writes events into a channel. With it, someone can add
            events that never happened: log poisoning.
        eds:
          tone: bad
          note: DeleteEventDataStore
          text: >-
            `cloudtrail:DeleteEventDataStore` deletes the store and the events in it.
            `cloudtrail:StopEventDataStoreIngestion` keeps the store but stops new events arriving.
        trail:
          tone: bad
          note: PutInsightSelectors
          text: >-
            `cloudtrail:PutInsightSelectors` with an empty list turns Insights events off for the
            trail. The post does it through the console's own request.
      edges:
        ext>chan:
          tone: bad
          label: fake events
        chan>eds:
          cut: true
        ct>eds:
          cut: true
          label: ingestion stopped
        trail>soc:
          cut: true
          label: no Insights
        eds>soc:
          tone: bad
    - name: Guardrails
      tone: ok
      title: Keep these permissions to the people who need them
      text: >-
        The post's advice: scope the dangerous permissions with condition statements so only the
        intended principal can use them. Across an AWS organization, a service control policy can
        deny them outright, and an alert on these API calls catches anyone who tries.
      nodes:
        chan:
          tone: ok
          note: conditions
          text: >-
            Allow channel changes only to the principal that manages the integration, with an IAM
            condition.
        ext:
          tone: ok
          note: one writer
          text: Only the integration's own role should hold `PutAuditEvents` for that channel.
        eds:
          tone: ok
          note: termination protection
          text: >-
            Termination protection is on by default and blocks deletion; keep it on and limit who
            can turn it off. A deleted event data store waits seven days before it is removed and
            can be restored in that time.
        trail:
          tone: ok
          note: SCP deny
          text: >-
            Deny `PutInsightSelectors` and the other changes in a service control policy, except for
            a break-glass role.
        soc:
          tone: ok
          note: alert on the calls
          text: >-
            These API calls are themselves management events. Alert on DeleteChannel,
            DeleteEventDataStore, StopEventDataStoreIngestion and PutInsightSelectors.

Sequence type: sequence

Who talks to whom, one message at a time. Tabs compare the vulnerable flow with each fix. Readers step through or press Play.

From Meta AI agent account takeover

Each tab follows one design from the post. In all three, the agent can start a sensitive action but never finish it alone.
Show the data
designs:
  type: sequence
  title: Three designs that keep the agent away from the mutation
  kind: Defences
  caption: >-
    Each tab follows one design from the post. In all three, the agent can start a sensitive action
    but never finish it alone.
  lanes:
    - name: User
      kind: user
    - name: AI agent
      kind: system
    - name: Policy engine
      kind: guard
    - name: Tool
      kind: system
    - name: Verified email
      kind: guard
  modes:
    - name: 1. Agent only starts the flow
      tone: fix
      steps:
        - from: 0
          to: 1
          label: Change my email
          title: A normal request
          text: The user asks the agent to change their email.
        - from: 1
          to: 3
          label: start verified account flow
          title: No mutation by the agent
          text: >-
            The agent doesn't change anything. It only starts the platform's existing verified
            workflow for that account.
        - from: 3
          to: 4
          label: verification → email on file
          tone: ok
          title: The verified channel decides
          text: >-
            The verification goes to the address already on the account, not to anything the
            requester typed.
        - from: 1
          to: 0
          label: Verification sent to m•••@…
          title: The agent only reports back
          text: The agent never handles secrets. It shows a masked address and stops.
        - from: 4
          to: 3
          label: owner completes the change
          tone: ok
          title: Only the owner can finish
          text: >-
            The change completes through the already verified channel. Still worth adding: rate
            limits, one active verification per account, and no hint about whether an account
            exists, or the flow becomes a way to flood the real owner.
    - name: 2. Tool requires verification
      tone: fix
      steps:
        - from: 0
          to: 1
          label: Change my email
          title: Same request
          text: The user asks for an email change.
        - from: 1
          to: 3
          label: change_email(…, auth_token=None)
          title: The agent can call the tool
          text: The agent calls the tool, but without a token the tool only starts verification.
        - from: 3
          to: 4
          label: token → verified email
          tone: ok
          note: agent never sees the token
          title: The tool enforces the boundary
          text: >-
            The tool stores a pending action and sends a token to the verified email. Even a
            manipulated agent can't complete the change.
        - from: 0
          to: 3
          label: change_email(…, auth_token=REAL_TOKEN)
          title: The owner returns with the token
          text: Only someone who can read the verified inbox has the token.
        - from: 3
          to: 0
          label: Email updated
          tone: ok
          title: Changed, with proof
          text: >-
            The mutation happens only after a valid token. Rate-limit the first phase, or the victim
            gets flooded with verification emails.
    - name: 3. Policy layer in between
      tone: fix
      steps:
        - from: 0
          to: 1
          label: Change my email
          title: Same request
          text: The user asks for an email change.
        - from: 1
          to: 2
          label: execute_tool("change_email", params)
          title: No direct tool access
          text: The agent can't call tools at all. Every call goes to the policy engine.
        - from: 2
          to: 2
          label: auto=False, needs verification
          tone: ok
          title: Policy decides, not the prompt
          text: >-
            `change_email` is marked as not automatic and requires account ownership. Authorization
            lives in one place.
        - from: 2
          to: 4
          label: token → verified email
          tone: ok
          title: Verification first
          text: The policy engine stores the pending action and sends the token to the verified email.
        - from: 0
          to: 2
          label: confirm with token
          title: The owner confirms
          text: The user confirms through the policy engine, not through the agent.
        - from: 2
          to: 3
          label: change_email(params)
          title: Only now does the tool run
          text: The policy engine calls the tool on the user's behalf.
        - from: 3
          to: 0
          label: Email updated
          tone: ok
          title: Clean and central
          text: >-
            The agent is an interface; the policy engine is the authority. It still fails if the
            policy is incomplete, checks ownership too late, marks a sensitive tool as automatic, or
            checks one parameter while the tool uses another.

Stack type: stack

What a model actually reads, layer by layer, marked trusted, untrusted or from the user. Shows hidden layers, and which ones a fix quotes or drops.

From Hacking AI browsers

The first tab shows the two Comet findings. The second is a general safer design, not Perplexity's own fix, which the vendor didn't describe. Click a layer for details.
Show the data
context:
  type: stack
  title: What the summarizer reads when you press Summarize
  kind: Context
  label: Model context, top to bottom
  caption: >-
    The first tab shows the two Comet findings. The second is a general safer design, not
    Perplexity's own fix, which the vendor didn't describe. Click a layer for details.
  modes:
    - name: As found
      tone: bad
      title: Two untrusted layers can steer the summary
      text: >-
        The document and the highlighted text arrive next to the template with nothing marking them
        as data. Text inside them can fill template fields or ride along into the summary.
      layers:
        - name: Summary template
          source: Comet
          trust: trusted
          text: >-
            The structure Comet asks the model to fill: a **visible content** field, language and
            region, and other fields. It shows up in every summary.
        - name: Page or PDF text
          source: The document
          trust: untrusted
          text: >-
            Everything in the document. The first finding: text in a PDF set the **visible content**
            field to a value the author chose, and the summary used it instead of the real content.
        - name: Highlighted text
          source: The page
          trust: untrusted
          hidden: true
          text: >-
            Whatever is selected when you summarize. The second finding: a page can select text with
            a script, so the selection, and anything written in it, ends up in the summary without
            the user choosing it.
        - name: Summarize
          source: You
          trust: user
          text: The only part the user actually asked for.
    - name: Safer design
      tone: ok
      title: Untrusted text goes in as quoted data
      text: >-
        The template stays the app's alone. The document is passed as quoted material the model is
        told not to take instructions from, and the selection is only included when the user picked
        it.
      layers:
        - name: Summary template
          source: Comet
          trust: trusted
          text: Fields are set by the app. Nothing in the document can assign a value to them.
        - name: Page or PDF text
          source: The document
          trust: untrusted
          fenced: true
          text: >-
            Quoted and labelled as the material to summarize. Instructions inside it are content to
            report, not orders to follow.
        - name: Highlighted text
          source: The page
          trust: untrusted
          gone: true
          text: >-
            Left out unless the user made the selection themselves. A selection made by a page
            script never reaches the model.
        - name: Summarize
          source: You
          trust: user
          text: The user's request, still the only instruction.

Pipeline type: pipeline

An input walking through checks. Each scenario shows where it passes, gets flagged, or stops, and what came out.

From Phishing LLMs

The first three runs are from the post's local copy of Prompt Shield, the fourth from the LLMail-Inject CTF. Pick an email to watch where it stops.
Show the data
filter:
  type: pipeline
  title: Four emails through the filter
  kind: Defence path
  inputLabel: Email
  caption: >-
    The first three runs are from the post's local copy of Prompt Shield, the fourth from the
    LLMail-Inject CTF. Pick an email to watch where it stops.
  stages:
    - name: Pattern scan
      sub: looks for email addresses
    - name: Risk score
      sub: blocks at 0.75
    - name: Summarizer
      sub: the LLM
    - name: Action
      sub: send email
  scenarios:
    - name: Normal email
      input: A short note asking for a summary.
      path:
        - result: pass
          note: Nothing found
        - result: pass
          note: Risk 0.03
        - result: pass
          note: Summarized
        - result: skip
          note: Nothing to do
      outcome:
        tone: acc
        title: Allowed
        text: Directive score was high (0.88), but the final risk score stayed at 0.03.
    - name: Plain address
      tone: ok
      input: An urgent request to send an email to an outside address, written out with @.
      path:
        - result: block
          note: Email pattern, 0.94
        - null
        - null
        - null
      outcome:
        tone: ok
        title: Blocked
        text: >-
          The risk score was only 0.53, under the 0.75 threshold. The email-address pattern alone
          was enough to block it.
    - name: Encoded @
      tone: bad
      input: The same request with the @ written as the HTML entity &#64;.
      path:
        - result: warn
          note: Seen, 0.92, not acted on
        - result: pass
          note: Risk 0.01
        - result: pass
          note: Summary repeats the request
        - result: skip
          note: Not in the local copy
      outcome:
        tone: bad
        title: Allowed
        text: >-
          The contact pattern was detected, but the risk score fell to 0.01 and the email went
          through. In the CTF this trick did not work, which suggests that filter normalised the
          input first.
    - name: Flooded (CTF)
      tone: bad
      input: A long email padded with filler, with the request near the end.
      path:
        - result: pass
          note: Only the start was read
        - result: pass
          note: Below threshold
        - result: pass
          note: Read the whole email
        - result: bad
          note: Email sent
      outcome:
        tone: bad
        title: Got through
        text: >-
          Flooding the input solved the challenge. The post's leading explanation: the classifier
          checks a fixed number of tokens, the model reads them all.

Window type: window

A scanner that reads only part of a long input: token limits, truncated logs, sampled traffic. Shows what falls outside it.

From Phishing LLMs

One of the explanations the post gives for the CTF result. The limit is drawn to scale for the picture only; Prompt Shield's real limit isn't public.
Show the data
flood:
  type: window
  title: Why flooding can beat a classifier
  kind: Truncation
  scannerLabel: Classifier reads
  limitLabel: token limit
  limit: 40
  caption: >-
    One of the explanations the post gives for the CTF result. The limit is drawn to scale for the
    picture only; Prompt Shield's real limit isn't public.
  modes:
    - name: Short email
      units:
        - 'n': 12
          kind: text
        - 'n': 4
          kind: inj
        - 'n': 6
          kind: text
      result:
        tone: ok
        title: Caught
        text: The instruction sits inside the part the classifier reads.
    - name: Flooded email
      tone: bad
      units:
        - 'n': 6
          kind: text
        - 'n': 72
          kind: fill
        - 'n': 4
          kind: inj
        - 'n': 4
          kind: text
      result:
        tone: bad
        title: Missed
        text: >-
          The classifier stops at its limit. The model still reads the whole email, instruction
          included. Checking the input in overlapping chunks, or checking what the model is about to
          do, closes this gap.

Bars type: bars

Values against a threshold, with a note on each bar. Use real numbers from the post only.

From Phishing LLMs

Final risk scores from the post's debug output. Only the plain address was blocked, and not because of its score.
Show the data
scores:
  type: bars
  title: Risk scores against the block threshold
  kind: Prompt Shield, local copy
  caption: >-
    Final risk scores from the post's debug output. Only the plain address was blocked, and not
    because of its score.
  max: 1
  threshold:
    value: 0.75
    label: Block threshold, 0.75
  items:
    - label: Normal email
      value: 0.03
      display: '0.03'
      note: Allowed
    - label: Plain address
      value: 0.53
      display: '0.53'
      tone: ok
      note: Blocked by the email pattern, not the score
    - label: Encoded @
      value: 0.01
      display: '0.01'
      tone: bad
      note: Allowed, with an instruction inside

Anatomy type: anatomy

A string split into parts you can click: a filter, a path, a header, a token. Play reads it left to right.

From LDAP the AD

The group filter from the post's Get-LDAP example. Click a part, or press Play to read it left to right.
Show the data
filter:
  type: anatomy
  title: Reading an LDAP filter
  kind: Anatomy
  word: Part
  caption: >-
    The group filter from the post's Get-LDAP example. Click a part, or press Play to read it left
    to right.
  examples:
    - name: Group filter
      parts:
        - t: (&
          tone: warn
          label: AND
          text: >-
            Every condition inside must match. `|` would mean OR, and `!` NOT. LDAP filters put the
            operator first.
        - t: (objectclass=group)
          label: Kind of object
          text: >-
            Only entries whose objectClass is `group`. Swap it for `user` or `computer` to list
            those instead.
        - t: (cn=
          label: 'Attribute: common name'
          text: >-
            `cn` is the object's common name, one of the attributes listed in the post's ObjectClass
            section.
        - t: '*admin*'
          tone: warn
          label: Wildcard match
          text: >-
            `*` matches any text, so this finds any group with **admin** anywhere in its name:
            Domain Admins, Schema Admins, a helpdesk-admins group.
        - t: )
          label: Closes the condition
          text: Ends `(cn=*admin*)`.
        - t: )
          tone: warn
          label: Closes the AND
          text: Ends the whole filter. Every `(` needs its `)`, or the server rejects the search.
    - name: User filter
      parts:
        - t: (&
          tone: warn
          label: AND
          text: Both conditions must match.
        - t: (objectClass=user)
          label: Kind of object
          text: Only user objects.
        - t: (cn=
          label: 'Attribute: common name'
          text: Match on the object's common name.
        - t: '*Terminator*'
          tone: warn
          label: Wildcard match
          text: >-
            Any name containing **Terminator**. In the post this returns
            `CN=Terminator,CN=Users,DC=m19oARSENAL,DC=local`.
        - t: ))
          tone: warn
          label: Closes both
          text: Ends the name condition and the AND.

Chain type: chain

Ordered stages, clicked or played in turn, each with a note and optional code.

From LDAP the AD

An LDAP path is read from right to left: from the top of the directory down to the object.
Show the data
dn:
  type: chain
  title: Reading an LDAP path
  kind: Structure
  word: Part
  caption: 'An LDAP path is read from right to left: from the top of the directory down to the object.'
  steps:
    - title: DC=com
      sub: domain component
      text: The top of the namespace. Each `DC` is one label of the domain name.
    - title: DC=m19oARSENAL
      sub: domain component
      text: Together with `DC=com`, this names the domain `m19oARSENAL.com`.
    - title: CN=Users
      sub: container
      text: The default container where new users and groups are created.
    - title: CN=Administrator
      sub: the object
      tone: acc
      text: The entry itself. The full path is `LDAP://CN=Administrator,CN=Users,DC=m19oARSENAL,DC=com`.

Tree type: tree

A hierarchy to explore, with a detail panel for each level.

From Enum the AD

Definitions from the post. Click any level to see what it is and how to list it with ADModule.
Show the data
structure:
  type: tree
  title: How Active Directory is organised
  kind: Structure
  caption: Definitions from the post. Click any level to see what it is and how to list it with ADModule.
  nodes:
    - name: Forest
      tag: top level
      tone: acc
      text: >-
        The highest level of the organisation hierarchy. A forest is made of trees, and the trees
        contain domains.
      children:
        - name: Tree
          text: A group of domains that share the same root.
          children:
            - name: Domain
              tone: acc
              text: >-
                The foundation of Active Directory and the main administrative unit. Domain Services
                keeps the directory and handles how users interact with the domain.
              code: |-
                Get-ADDomain
                Get-ADDomain -Identity foo.local
                Get-ADDomain | Select DomainSID
              children:
                - name: Containers
                  text: >-
                    The **domain container** is the root of the hierarchy, the **built-in
                    container** holds the default service administrator accounts, and the **users
                    container** is where new users and groups land by default.
                - name: Organizational units
                  text: >-
                    OUs group users, service accounts and computers so administrators can be
                    assigned to them and group policy can be applied to them.
                  code: Get-ADOrganizationalUnit -Filter * -Properties *
                - name: Group policy
                  text: >-
                    Policies applied to the domain and its OUs. The built-in GroupPolicy module
                    lists them and can produce an HTML report.
                  code: Get-GPO -All
                - name: Objects
                  text: >-
                    A single element in the directory: a user, a group, an application, or a device
                    such as a printer.
                  children:
                    - name: Users
                      code: Get-ADUser -Identity <NAME> -Properties *
                      text: User accounts and their properties, such as when the password was last set.
                    - name: Groups
                      code: |-
                        Get-ADGroup -Filter * | select Name
                        Get-ADGroupMember -Identity "Domain Admins" -Recursive
                      text: >-
                        Groups organise users into logical sets, and access control is given to each
                        level.
                    - name: Computers
                      code: Get-ADComputer -Filter *
                      text: Computer accounts joined to the domain.
                - name: ACLs
                  tone: warn
                  text: >-
                    An access control list is a list of access control entries. A **DACL** decides
                    who is allowed or denied access to an object; an object with no DACL grants full
                    access to everyone. A **SACL** decides which access attempts are written to the
                    security event log.

Matrix type: matrix

A comparison table. Cells can be text, or yes, no and partly marks.

From Attacking AWS CloudTrail 101

From the post's three sections. The last column is what a defender stops seeing.
Show the data
perms:
  type: matrix
  title: The permissions in this post
  kind: Reference
  caption: From the post's three sections. The last column is what a defender stops seeing.
  columns:
    - Permission
    - What it does
    - What defenders lose
  rows:
    - - '`cloudtrail:DeleteChannel`'
      - Removes a channel
      - Events from that integration
    - - '`cloudtrail-data:PutAuditEvents`'
      - Writes events into a channel
      - 'Trust in the store: fake events look real'
    - - '`cloudtrail:DeleteEventDataStore`'
      - Deletes an event data store
      - The stored events and queries on them
    - - '`cloudtrail:StopEventDataStoreIngestion`'
      - Stops new events going in
      - Everything from that moment on
    - - '`cloudtrail:PutInsightSelectors`'
      - Changes or clears Insights selectors
      - Alerts on unusual API activity

Curve type: curve

A journey drawn as a line with points to click.

From Cybersecurity easy? Huh

Click a point on the line.
Show the data
journey:
  type: curve
  title: How the journey looks
  kind: Journey
  caption: Click a point on the line.
  axes:
    x: What you've learned
    'y': How much you think you know
  start: 1
  points:
    - x: 0
      'y': 0.1
      label: Day one
      text: You start learning some things.
    - x: 0.2
      'y': 0.9
      label: I know everything
      text: A little knowledge feels like a lot. You may think you know everything.
    - x: 0.5
      'y': 0.25
      label: How much I don't know
      text: >-
        As you learn more, you realise how much you don't know. Imposter syndrome lives here, and it
        happens to the best of us.
    - x: 1
      'y': 0.7
      label: Keep learning
      text: >-
        After that realisation you keep learning without stopping. Track your progress: compare
        where you are with where you were a year ago.

Glance type: glance

The facts of a finding in one row, at the top of a post: target, bug class, status.

From Hacking AI browsers

Show the data
glance:
  type: glance
  items:
    - k: Targets
      v: Comet (AI browser), Perplexity Chat
    - k: Findings
      v: 3 reported
    - k: Vendor response
      v: NA, NA, out of scope
    - k: Status
      v: All three fixed
      tone: ok

Bytes type: bytes

Numbers decoded into text one cell at a time: encodings, obfuscated strings, character codes.

Show the data
bytes:
  type: bytes
  title: Character codes decoded one at a time
  kind: Bytes
  text: CVE-2021-24970
  caption: Press Decode. The numbers are the ASCII codes of one of Mohamed's CVE IDs.
Search every post

Loading search…