# ncsc-nl/php2shell architecture

> Architecture diagram of the GitHub repository ncsc-nl/php2shell, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ncsc-nl/php2shell
- Repository: https://github.com/ncsc-nl/php2shell

## Overview

This repository is an operational security advisory and reference inventory for two PHP vulnerabilities, not a runtime application. Its main user workflow is to identify potentially affected PHP software, consult patch and mitigation guidance, and monitor advisories and exploit activity. The inventory is maintained as SPDX data and can be rendered into alphabetized Markdown lists. The graph reflects documented capabilities and the sampled generator; detection and mitigation implementation details were not sampled.

Main entry points: [`README.md`](https://github.com/ncsc-nl/php2shell/blob/main/README.md) (Vulnerability advisory), [`detection_mitigation`](https://github.com/ncsc-nl/php2shell/tree/main/detection_mitigation) (Detection and mitigation), [`software`](https://github.com/ncsc-nl/php2shell/tree/main/software) (Software inventory), [`software/spdx/PHP_Downstream_Inventory.spdx3.json`](https://github.com/ncsc-nl/php2shell/blob/main/software/spdx/PHP_Downstream_Inventory.spdx3.json) (SPDX inventory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_guidance["Security guidance"]
  node_advisory["Vulnerability advisory<br/>[README.md]"]
  node_detection["Detection and mitigation"]
  node_cpanel["cPanel mitigation"]
end

subgraph group_inventory["Software inventory"]
  node_software_inventory["Software inventory"]
  node_spdx["SPDX inventory"]
  node_generated_lists["Alphabetized lists"]
end

subgraph group_generation["List generation"]
  node_generator["List generator"]
end

node_admin(("Administrator"))
node_php(("PHP project"))
node_vendors(("Product vendors"))

node_admin -->|"consults"| node_advisory
node_advisory -->|"identify affected software"| node_software_inventory
node_advisory -->|"consults mitigations"| node_detection
node_detection -->|"includes"| node_cpanel
node_php -->|"publishes fixes"| node_advisory
node_vendors -->|"provide backports"| node_advisory
node_advisory -->|"recommends monitoring"| node_admin
node_spdx -->|"provides inventory data"| node_generator
node_generator -->|"writes lists"| node_generated_lists
node_software_inventory -->|"maintained in"| node_spdx

click node_advisory "https://github.com/ncsc-nl/php2shell/blob/main/README.md"
click node_detection "https://github.com/ncsc-nl/php2shell/tree/main/detection_mitigation"
click node_cpanel "https://github.com/ncsc-nl/php2shell/blob/main/detection_mitigation/cpanel/php2shell-mitigate.sh"
click node_software_inventory "https://github.com/ncsc-nl/php2shell/tree/main/software"
click node_spdx "https://github.com/ncsc-nl/php2shell/blob/main/software/spdx/PHP_Downstream_Inventory.spdx3.json"
click node_generated_lists "https://github.com/ncsc-nl/php2shell/tree/main/software"
click node_generator "https://github.com/ncsc-nl/php2shell/blob/main/tools/generate_software_list_from_spdx3.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_advisory,node_detection,node_cpanel toneBlue
class node_software_inventory,node_spdx,node_generated_lists toneAmber
class node_generator toneMint
class node_admin,node_php,node_vendors toneIndigo
```

## Components

### Security guidance

- [Vulnerability advisory](https://github.com/ncsc-nl/php2shell/blob/main/README.md): `README.md`
- [Detection and mitigation](https://github.com/ncsc-nl/php2shell/tree/main/detection_mitigation): `detection_mitigation`
- [cPanel mitigation](https://github.com/ncsc-nl/php2shell/blob/main/detection_mitigation/cpanel/php2shell-mitigate.sh): `detection_mitigation/cpanel/php2shell-mitigate.sh`

### Software inventory

- [Software inventory](https://github.com/ncsc-nl/php2shell/tree/main/software): `software`
- [SPDX inventory](https://github.com/ncsc-nl/php2shell/blob/main/software/spdx/PHP_Downstream_Inventory.spdx3.json): `software/spdx/PHP_Downstream_Inventory.spdx3.json`
- [Alphabetized lists](https://github.com/ncsc-nl/php2shell/tree/main/software): `software`

### List generation

- [List generator](https://github.com/ncsc-nl/php2shell/blob/main/tools/generate_software_list_from_spdx3.py): `tools/generate_software_list_from_spdx3.py`

### Other components

- **Administrator**
- **PHP project**
- **Product vendors**

## Connections

- Administrator → Vulnerability advisory: consults (evidence: `README.md`)
- Vulnerability advisory → Software inventory: identify affected software (evidence: `README.md`)
- Vulnerability advisory → Detection and mitigation: consults mitigations (evidence: `README.md`)
- Detection and mitigation → cPanel mitigation: includes (evidence: `README.md`)
- PHP project → Vulnerability advisory: publishes fixes (evidence: `README.md`)
- Product vendors → Vulnerability advisory: provide backports (evidence: `README.md`)
- Vulnerability advisory → Administrator: recommends monitoring (evidence: `README.md`)
- SPDX inventory → List generator: provides inventory data (evidence: `tools/generate_software_list_from_spdx3.py`)
- List generator → Alphabetized lists: writes lists (evidence: `tools/generate_software_list_from_spdx3.py`)
- Software inventory → SPDX inventory: maintained in (evidence: `README.md`)
