Day 7: Coordinated disclosure
Goal: set up a point of contact for security reports (SECURITY.md, security.txt), accept a real researcher’s report, reproduce and assess it, fix the vulnerability in 1.0.2 and publish the security advisory as a CSAF document · Duration: about 140 min · Prerequisite: Day 6 completed
State before this chapter
# on werk1
git -C ~/lotse describe --tagsExpected:
v1.0.1
# on werk1
curl -s http://10.43.146.193:8080/gesundInsert your ClusterIP from Day 5.
Expected:
{"status":"ok","version":"1.0.1"}
Introduction
So far you have looked for vulnerabilities in other people’s parts: in Werkzeug, OpenSSL, Debian. Today someone from outside gets in touch and writes that your own code has a vulnerability. The person calls herself “kiesel”, has examined the Bewerbungslotse in her own test installation and sends you a command that reads files from the container.
Now it shows whether your factory is prepared. Can the researcher find an address at all? Does she know which rules apply and when she may publish? Where do you keep the report while there is no fix yet? And how do your customers learn about it once the update is there – in a way their tools can read automatically?
This exact process is called coordinated disclosure: the vulnerability is first reported to the manufacturer, the manufacturer fixes it, and only then is it published – agreed between both sides.
Today you will learn:
- to set up a point of contact:
SECURITY.mdwith your policy andsecurity.txtaccording to RFC 9116, - to accept a report confidentially and reproduce it, even if it doesn’t work at first,
- to look for variants while checking – and to find a second, more serious vulnerability on the way,
- to assess vulnerabilities with a CVSS vector,
- to fix the vulnerability and ship 1.0.2 signed and with evidence, as on Day 6,
- to write the security advisory as CSAF 2.0 and check it with
csaf_validator.
Background
The picture of the day: the reporter at the factory gate
A driver notices that the bonnet of one model can be opened while driving. He wants to tell the factory before somebody gets hurt. At the factory gate there is a sign with the address of the quality department. In the lobby there is a leaflet with the rules: what you should send us, when we answer, and that we won’t sue you if you stick to the rules.
The quality department opens a confidential file for the report, reproduces the defect in its own workshop and checks at the same time whether the boot has the same weakness. Then it builds a corrected part, issues a recall and sends out a recall letter that not only people but also the workshops’ computers can read. Until then the defect stays under lock and key – and the reporter is named in the letter if he wishes.
- Address at the factory gate =
security.txt: a small file in a fixed place that anyone can find. - Leaflet in the lobby =
SECURITY.md: your policy for coordinated disclosure. - Confidential file = notification file outside the repository, until the advisory is published.
- Reproducing in the workshop = reproducing, in your own lab, never at customers’ sites.
- Checking the boot as well = variant analysis: where else is the same defect hiding?
- Machine-readable recall letter = CSAF document.
The terms
| Term | Meaning | In the picture |
|---|---|---|
| coordinated disclosure (CVD) | first report, then fix, then publish together | tip to the quality department instead of the newspaper |
| point of contact | contact through which users and researchers report vulnerabilities | address at the factory gate |
security.txt |
text file under /.well-known/security.txt, described in
RFC 9116 |
sign at the factory gate |
SECURITY.md |
policy in the repository: how to report, what we promise, which rules | leaflet in the lobby |
| embargo | time during which the details stay confidential | file under lock and key |
| triage | check, reproduce, classify a report and decide | findings in the workshop |
| variant analysis | look for the same defect in other places | check the boot as well |
| path traversal (CWE-22) | leave a folder with ../ |
master key for all doors |
| CVSS | scheme that describes the severity of a vulnerability as a vector and a number from 0 to 10 | damage class |
| security advisory | publication about a fixed vulnerability | recall letter |
| CSAF | Common Security Advisory Framework: security advisory as JSON according to an OASIS standard | recall letter for the workshop computers |
Remember: Whoever has no address at the factory gate learns about their defects from the newspaper. Point of contact and policy belong to the product before the first report arrives.
What the law requires
Article 13(8) CRA requires manufacturers to have “appropriate policies and procedures, including coordinated vulnerability disclosure policies, referred to in Part II, point (5), of Annex I” to “process and remediate” reported vulnerabilities. Annex I, Part II CRA gets specific. The manufacturer shall
- point 4 “once a security update has been made available, share and publicly disclose information about fixed vulnerabilities” – with information that lets users identify the affected product, the impacts and the severity, and with help on remediation,
- point 5 “put in place and enforce a policy on coordinated vulnerability disclosure”,
- point 6 facilitate the sharing of information about vulnerabilities, “including by providing a contact address for the reporting of the vulnerabilities discovered in the product with digital elements”.
Under Article 13(17), the manufacturer designates a single point of contact that is “easily identifiable by the users”; the means of communication must not be limited “to automated tools” – a chatbot alone is therefore not enough. Annex II, point 2 requires that this single point of contact and the policy on coordinated vulnerability disclosure are part of the information for users.
Recital 76 adds: reporters should also be able to turn “indirectly, and where requested anonymously” to the CSIRT designated as coordinator – in Germany that is the BSI, the federal cybersecurity agency (§ 5 BSIG). Moreover, manufacturers should consider publishing their security policies “in machine-readable format”.
By the way, point 4 allows you to delay publication “in duly justified cases” until users have been able to apply the update. If, on the other hand, a vulnerability is actively exploited, the reporting obligation under Article 14 applies in addition – that is Day 8.
Drill 1: The address at the factory gate
Where you are: on werk1, in the repository
~/lotse.What you have afterwards:
SECURITY.mdandsecurity.txtin the repository, committed.
Step 1 – write the policy. SECURITY.md
is the name that GitHub, GitLab and Forgejo recognise and show next to
the code as “Security policy”. The file answers the four questions a
researcher has before reporting: where to, what to send along, what
happens next, which rules apply.
# on werk1
nano ~/lotse/SECURITY.md# Sicherheit beim Bewerbungslotsen
Konzept der Beispielwerk GmbH für die koordinierte Offenlegung von
Schwachstellen (Anhang I Teil II Nr. 5 CRA).
## Schwachstelle melden
- E-Mail: [email protected]
- Auf Wunsch anonym über das nationale CSIRT, das als Koordinator
benannt ist (in Deutschland das BSI)
- Bitte angeben: betroffene Version, Schritte zum Nachstellen,
Auswirkung, ob und wie wir dich im Sicherheitshinweis nennen dürfen
## Was wir zusagen
- Eingangsbestätigung innerhalb von 3 Werktagen
- Erste Bewertung mit Schweregrad innerhalb von 10 Werktagen
- Behebung so schnell wie möglich, Ziel: 90 Tage
- Veröffentlichung erst nach dem Update, Termin stimmen wir mit dir ab
- Nennung im Sicherheitshinweis, wenn du es möchtest
## Regeln für Forschende
- Teste nur eigene Installationen, nicht unsere oder die von Kunden
- Lies, ändere oder lösche keine fremden Daten
- Keine Lasttests, kein Social Engineering
- Wer sich daran hält, muss von uns keine rechtlichen Schritte fürchten
## Unterstützte Versionen
| Version | Sicherheitsupdates |
|---|---|
| 1.0.x | ja, bis 12/2032 |
## Sicherheitshinweise
- Maschinenlesbar als CSAF 2.0 im Ordner csaf/ dieses Repositorys
- Übersicht in SCHWACHSTELLEN.md| Section | Purpose |
|---|---|
| Schwachstelle melden (report a vulnerability) | the contact address (point 6) and the anonymous route via the CSIRT (recital 76) |
| Was wir zusagen (what we promise) | deadlines you are measured against; 90 days are common in the industry |
| Regeln für Forschende (rules for researchers) | allows research in good faith and protects other people’s data (“safe harbor”) |
| Unterstützte Versionen (supported versions) | which versions get updates – your support period from Day 1 |
| Sicherheitshinweise (security advisories) | where the publications under point 4 appear |
beispielwerk.example is a reserved example domain (RFC
2606); in real life your company address goes here. A dedicated
security@ mailbox is better than a person’s address: it
survives holidays and resignations.
Step 2 – the sign at the factory gate.
security.txt is shorter and meant for machines: tools and
researchers fetch
https://<host>/.well-known/security.txt without first
searching through a website. You put the file in the repository; in
Drill 4 the Lotse serves it itself.
# on werk1
nano ~/lotse/security.txtContact: mailto:[email protected]
Expires: 2027-12-02T23:00:00.000Z
Preferred-Languages: de, en
Policy: https://beispielwerk.example/bewerbungslotse/SECURITY.md| Field | Meaning |
|---|---|
Contact: |
mandatory: where to report, as a mailto:,
tel: or https: address; several lines
allowed |
Expires: |
mandatory: until when the information is valid, timestamp according to RFC 3339; at most one year recommended |
Preferred-Languages: |
languages in which you can read reports |
Policy: |
link to your policy, here the SECURITY.md |
Expires forces you to look at the file every year. An
expired security.txt says: nobody takes care of this any
more.
Step 3 – record it.
# on werk1
cd ~/lotse# on werk1
git add SECURITY.md security.txt# on werk1
git commit -m "Anlaufstelle: SECURITY.md und security.txt"Expected (your commit number differs):
[main 093cd6b] Anlaufstelle: SECURITY.md und security.txt
2 files changed, 42 insertions(+)
create mode 100644 SECURITY.md
create mode 100644 security.txt
Remember:
SECURITY.mdis the leaflet for people,security.txtthe sign for machines. Both name the same address – andExpiresreminds you every year to check it.
Save your progress? Sign up for free
Drill 2: The report comes in
Where you are: on werk1.
What you have afterwards: a confidential notification file and the vulnerability reproduced in the lab.
On 3 December at 2 p.m. this message is in the security@
mailbox – you recreate it here, nothing is sent.
Step 1 – a folder under lock and key. As long as there is no fix, the report is a guide to an attack. It therefore does not belong in the repository, which someone will publish at some point, but in a folder that only you may read.
# on werk1
mkdir -m 700 ~/meldungen-m 700sets the permissions right at creation: read, write, enter only for you.~/meldungenlies outside~/lotse– nogit add .catches it by accident.
Step 2 – open the file. You assign the number
BW-2026-001 yourself: the factory’s abbreviation, year,
sequence number. It accompanies the vulnerability all the way into the
security advisory.
# on werk1
nano ~/meldungen/BW-2026-001.md# BW-2026-001 – vertraulich bis zur Veröffentlichung
## Eingang
- Eingegangen: 2026-12-03 14:00 über [email protected]
- Von: „kiesel“ (Pseudonym), möchte im Hinweis genannt werden
- Eingangsbestätigung: 2026-12-03 14:20 (Frist 3 Werktage)
## Meldung (wörtlich)
> Der Bewerbungslotse 1.0.1 liefert über GET /api/anlagen/<name>
> beliebige Dateien des Containers aus. Nachstellen:
> curl --path-as-is http://<lotse>:8080/api/anlagen/../../etc/passwd
> Ich habe nur meine eigene Testinstallation geprüft.
> Veröffentlichung von meiner Seite frühestens in 90 Tagen.
## NachstellungThe acknowledgement of receipt after 20 minutes easily meets the
promise in SECURITY.md (3 working days). You fill in the
section “Nachstellung” shortly.
# on werk1
ls -ld ~/meldungenExpected (time differs):
drwx------ 2 ubuntu ubuntu 4096 Dec 3 14:31 /home/ubuntu/meldungen
What you see: drwx------ – only the
owner ubuntu gets in. The file inside does have the usual
permissions -rw-rw-r--, but without access to the folder
nobody else can open it.
Step 3 – type in the command from the report,
almost. A colleague tries it out quickly and leaves out the odd
option --path-as-is:
# on werk1
curl -s -w "\n%{http_code}\n" http://10.43.146.193:8080/api/anlagen/../../etc/hostname-ssuppresses the progress display.-w "\n%{http_code}\n"appends the HTTP status after the response./api/anlagen/../../etc/hostnameis supposed to go two levels up from the attachments folder and then to/etc/hostname.
Expected:
<!doctype html>
<html lang=en>
<title>404 Not Found</title>
<h1>Not Found</h1>
<p>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.</p>
404
“Not reproducible,” says the colleague. Before you believe him: what
did curl actually send?
# on werk1
curl -v -s -o /dev/null http://10.43.146.193:8080/api/anlagen/../../etc/passwd-vshows the request (lines with>) and the response (lines with<).-o /dev/nullthrows the content away; here only what goes over the wire matters.
Expected (excerpt):
> GET /etc/passwd HTTP/1.1
> Host: 10.43.146.193:8080
…
< HTTP/1.1 404 NOT FOUND
< Server: gunicorn
What you see: curl resolved the dots
itself – /api/anlagen/../../etc/passwd became
/etc/passwd before the request left the machine. That is
what RFC 3986 prescribes for URLs (“remove dot segments”). The Lotse has
no route under /etc/passwd, hence 404. The Lotse never saw
the dots. That is exactly why the report says
--path-as-is.
Step 4 – reproduce it literally.
# on werk1
curl -s -w "\n%{http_code}\n" --path-as-is http://10.43.146.193:8080/api/anlagen/../../etc/hostname--path-as-issends the path unchanged, with all../.
Expected:
<!doctype html>
<html lang=en>
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>
500
A 500 is not “not affected”. The server stumbled over something – the log says what:
# on werk1
kubectl -n lotse logs deploy/lotse --tail=3logs deploy/lotsereads the log of a pod of the Deploymentlotse.--tail=3shows only the last three lines.
Expected:
stat = os.stat(path)
^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/daten/anlagen/../../etc/hostname'
What you see: The path reached the file system
unfiltered – so the vulnerability is real. It only failed because
/daten/anlagen doesn’t exist yet: Linux walks a path folder
by folder, and .. from a folder that doesn’t exist leads
nowhere. The folder is only created with the first attachment. In every
real installation there have long been some.
Step 5 – upload an attachment, as every user does.
# on werk1
curl -s -F datei=@kurs/00/lebenslauf-mara.txt http://10.43.146.193:8080/api/bewerbungen/probe1/anlagen-F datei=@<file>sends the file as the form fielddatei, like a browser when uploading.probe1is an application number that doesn’t even exist – the Lotse accepts it anyway.
Expected:
{"gespeichert":"probe1/lebenslauf-mara.txt"}
Step 6 – once more.
# on werk1
curl -s -w "\n%{http_code}\n" --path-as-is http://10.43.146.193:8080/api/anlagen/../../etc/hostnameExpected (your pod name differs):
lotse-7f57646b9-7dktq
200
What you see: status 200 and the pod’s host name. The report is correct. Now the researcher’s example:
# on werk1
curl -s --path-as-is http://10.43.146.193:8080/api/anlagen/../../etc/passwdExpected (excerpt – the first lines and the last one):
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
…
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
Step 7 – measure what an attacker gets. The severity of a vulnerability depends on what can be read. Don’t guess, try the three most dangerous targets. First the process’s environment variables – they often contain passwords:
# on werk1
curl -s --path-as-is -o umgebung.bin http://10.43.146.193:8080/api/anlagen/../../proc/self/environ/proc/self/environcontains the environment of the process that reads the file – here, Gunicorn.-o umgebung.binsaves the response instead of writing a possible password to the screen.
# on werk1
ls -l umgebung.binExpected (time differs):
-rw-rw-r-- 1 ubuntu ubuntu 0 Dec 3 14:28 umgebung.bin
What you see: zero bytes. send_file
asks the file system for the size, and files under /proc
always report 0 – so the Lotse sends nothing. Luck, not intent. Next,
the source code:
# on werk1
curl -s --path-as-is -o quelltext.py -w "%{http_code} %{size_download}\n" http://10.43.146.193:8080/api/anlagen/../../app/app.py%{size_download}prints how many bytes arrived.
Expected:
200 2750
The whole source code – whoever has it can look for further bugs at leisure. Finally the service account’s token, with which you could talk to the Kubernetes API:
# on werk1
curl -s --path-as-is -o /dev/null -w "%{http_code} %{size_download}\n" http://10.43.146.193:8080/api/anlagen/../../var/run/secrets/kubernetes.io/serviceaccount/tokenExpected:
500 265
What you see: 500 – the file doesn’t exist. On Day 5
you set automountServiceAccountToken: false; this one line
now keeps the token out of the vulnerability’s reach. Clear away the two
files:
# on werk1
rm umgebung.bin quelltext.pyRemember: “Not reproducible” often means: reproduced differently. Take the command from the report literally, read the log on a 500 – and then measure what really comes out instead of assuming the worst or the best.
Save your progress? Sign up for free
Drill 3: Check the boot as well
Where you are: on werk1.
What you have afterwards: the variant analysis for the neighbouring route, a second vulnerability and a CVSS assessment of both.
The researcher examined the download. The upload next to it also builds its path from the request – from the number and the file name:
ordner = ABLAGE / "anlagen" / nummer
datei.save(ordner / Path(datei.filename).name)Step 1 – attack the file name.
# on werk1
curl -s -F "datei=@kurs/00/lebenslauf-mara.txt;filename=../../app/app.py" http://10.43.146.193:8080/api/bewerbungen/probe1/anlagen;filename=…overrides the file name thatcurlsends along – just as an attacker would.
Expected:
{"gespeichert":"probe1/app.py"}
What you see: saved as probe1/app.py.
Path(…).name takes only the last part of the name; the
../ are dropped. This spot holds.
Step 2 – attack the number. The number cannot
contain a /, Flask splits the path there. But it can
be ..:
# on werk1
curl -s --path-as-is -F "datei=@kurs/00/lebenslauf-mara.txt;filename=probe.txt" http://10.43.146.193:8080/api/bewerbungen/../anlagenExpected:
{"gespeichert":"../probe.txt"}
The response already gives it away: ../probe.txt. Where
did the file go?
# on werk1
kubectl -n lotse exec deploy/lotse -- ls -l /datenexec deploy/lotse --runs the command after--in a pod of the Deployment.
Expected (your file numbers and times differ):
total 16
-rw-r--r-- 1 10001 10001 336 Dec 3 12:12 270969b6.json
drwxr-sr-x 3 10001 10001 4096 Dec 3 14:28 anlagen
-rw-r--r-- 1 10001 10001 320 Dec 3 12:13 b0ef4bd7.json
-rw-r--r-- 1 10001 10001 78 Dec 3 14:32 probe.txt
What you see: probe.txt lies directly
in /daten – next to the application files.
/daten/anlagen/.. became /daten.
Step 3 – slip in a file. What if the file looks like an application file? Create an invented application file, in a new course folder for today:
# on werk1
mkdir -p ~/kurs/07-pcreates missing folders as well and reports no error if it already exists.
# on werk1
nano ~/kurs/07/akte-probe.json{"nummer": "probe", "name": "Niemand", "stelle": "Test", "bewertung": {"passung": 5, "begruendung": "untergeschoben"}}# on werk1
curl -s --path-as-is -F "datei=@kurs/07/akte-probe.json;filename=probe.json" http://10.43.146.193:8080/api/bewerbungen/../anlagenExpected:
{"gespeichert":"../probe.json"}
# on werk1
curl -s http://10.43.146.193:8080/api/bewerbungen/probeExpected:
{"bewertung":{"begruendung":"untergeschoben","passung":5},"name":"Niemand","nummer":"probe","stelle":"Test"}
What you see: The Lotse serves the slipped-in file
like a real one – with a match of 5. Without logging in, anyone can put
assessments into the filing system that HR sorts by. That is more
serious than the reported vulnerability: it falsifies what the product
decides. This vulnerability gets its own number,
BW-2026-002; you found it yourself.
Step 4 – assess. CVSS 3.1 describes a vulnerability with eight metrics. Both vulnerabilities have the same attack profile, only the impact differs:
| Metric | Value | Why |
|---|---|---|
| AV (attack vector) | N – network | one HTTP request is enough |
| AC (complexity) | L – low | one curl command, no conditions apart from an existing
attachment |
| PR (privileges) | N – none | no login needed |
| UI (user interaction) | N – none | no victim has to click |
| S (scope) | U – unchanged | the impact stays within the Lotse |
| C (confidentiality) | 001: L, 002: N | 001 reads system and source files; token and environment stay protected |
| I (integrity) | 001: N, 002: H | 002 slips in files on which decisions are based |
| A (availability) | N | measured: no outage |
Using the formula of the CVSS 3.1 specification, this results in
5.3 (medium) for BW-2026-001 and 7.5
(high) for BW-2026-002. Had Day 5 not switched off the token,
001 would have C:H.
Step 5 – complete the file.
# on werk1
nano ~/meldungen/BW-2026-001.md# BW-2026-001 – vertraulich bis zur Veröffentlichung
## Eingang
- Eingegangen: 2026-12-03 14:00 über [email protected]
- Von: „kiesel“ (Pseudonym), möchte im Hinweis genannt werden
- Eingangsbestätigung: 2026-12-03 14:20 (Frist 3 Werktage)
## Meldung (wörtlich)
> Der Bewerbungslotse 1.0.1 liefert über GET /api/anlagen/<name>
> beliebige Dateien des Containers aus. Nachstellen:
> curl --path-as-is http://<lotse>:8080/api/anlagen/../../etc/passwd
> Ich habe nur meine eigene Testinstallation geprüft.
> Veröffentlichung von meiner Seite frühestens in 90 Tagen.
## Nachstellung
- 2026-12-03 nachgestellt auf 1.0.1: /etc/passwd und /app/app.py lesbar
- Klappt erst, wenn es mindestens eine Anlage gibt (sonst 500)
- Nicht lesbar: /proc/self/environ (leer), Service-Account-Token
(nicht eingehängt, Tag 5)
- Beim Prüfen gefunden: Upload mit Nummer ".." schreibt nach /daten
und kann Akten unterschieben → eigene Nummer BW-2026-002
## Bewertung
| Nummer | Lücke | CVSS 3.1 | Wert |
|---|---|---|---|
| BW-2026-001 | Datei lesen (Download) | AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N | 5.3 mittel |
| BW-2026-002 | Akte schreiben (Upload) | AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N | 7.5 hoch |
- Betroffen: 1.0.0 und 1.0.1
- Aktiv ausgenutzt: nicht bekannt (sonst Meldung nach Art. 14, Tag 8)
- Entscheidung: Sicherheitsupdate 1.0.2, danach Hinweis als CSAF“Aktiv ausgenutzt: nicht bekannt” (actively exploited: not known) is not a formality. If it were otherwise, the 24-hour deadline for the early warning notification under Article 14 CRA would run from the moment of awareness – Day 8.
Remember: A report shows you one door. Check the whole vehicle: every place that builds a path from the request is suspicious – and often you find the worse vulnerability yourself.
Save your progress? Sign up for free
Drill 4: The fix – version 1.0.2
Where you are: on werk1, in the repository
~/lotse.What you have afterwards: version 1.0.2 signed in the registry and in the cluster; both vulnerabilities closed,
security.txtunder/.well-known/.
Step 1 – fix the code. For both spots there is a ready-made, tested solution – home-made path checks are the most common source of exactly this vulnerability.
# on werk1
nano ~/lotse/app.py"""Bewerbungslotse – sortiert Bewerbungen mit einem Sprachmodell vor."""
import hmac
import json
import os
import uuid
from pathlib import Path
import requests
from flask import Flask, abort, jsonify, request, send_file, send_from_directory
VERSION = "1.0.2"
OLLAMA = os.environ.get("OLLAMA_URL", "http://ollama:11434")
MODELL = os.environ.get("MODELL", "qwen3:4b-instruct")
ABLAGE = Path(os.environ.get("ABLAGE", "/daten"))
# strip(): eine Passwortdatei endet meist mit einem Zeilenumbruch
ADMIN_PASSWORT = os.environ.get("ADMIN_PASSWORT", "").strip()
ANWEISUNG = (
"Du hilfst einer Personalabteilung. Bewerte, wie gut die Bewerbung zur Stelle passt. "
'Antworte nur mit JSON: {"passung": <Zahl von 1 bis 5>, "begruendung": "<ein Satz>"}'
)
app = Flask(__name__)
@app.get("/.well-known/security.txt")
def security_txt():
# Anlaufstelle für Sicherheitsmeldungen (RFC 9116)
return send_file(Path(__file__).with_name("security.txt"), mimetype="text/plain")
@app.get("/gesund")
def gesund():
return {"status": "ok", "version": VERSION}
@app.post("/api/bewerbungen")
def bewerbung_anlegen():
daten = request.get_json(force=True)
frage = f"Stelle: {daten['stelle']}\n\nBewerbung:\n{daten['text']}"
antwort = requests.post(
f"{OLLAMA}/api/chat",
json={
"model": MODELL,
"stream": False,
"format": "json",
"options": {"temperature": 0},
"messages": [
{"role": "system", "content": ANWEISUNG},
{"role": "user", "content": frage},
],
},
timeout=300,
)
antwort.raise_for_status()
bewertung = json.loads(antwort.json()["message"]["content"])
akte = {
"nummer": uuid.uuid4().hex[:8],
"name": daten["name"],
"stelle": daten["stelle"],
"bewertung": bewertung,
}
(ABLAGE / f"{akte['nummer']}.json").write_text(json.dumps(akte, ensure_ascii=False))
return jsonify(akte), 201
@app.get("/api/bewerbungen/<nummer>")
def bewerbung_lesen(nummer):
akte = ABLAGE / f"{nummer}.json"
if not nummer.isalnum() or not akte.exists():
abort(404)
return json.loads(akte.read_text())
@app.post("/api/bewerbungen/<nummer>/anlagen")
def anlage_hochladen(nummer):
# nur zu einer vorhandenen Bewerbung, nie ".." (BW-2026-002)
if not nummer.isalnum() or not (ABLAGE / f"{nummer}.json").exists():
abort(404)
datei = request.files["datei"]
ordner = ABLAGE / "anlagen" / nummer
ordner.mkdir(parents=True, exist_ok=True)
datei.save(ordner / Path(datei.filename).name)
return {"gespeichert": f"{nummer}/{Path(datei.filename).name}"}, 201
@app.get("/api/anlagen/<path:name>")
def anlage_herunterladen(name):
# send_from_directory bleibt im Ordner, sonst 404 (BW-2026-001)
return send_from_directory(ABLAGE / "anlagen", name)
@app.get("/api/admin/export")
def export():
if not ADMIN_PASSWORT:
abort(404)
zugang = request.authorization
if zugang is None or not hmac.compare_digest(zugang.password or "", ADMIN_PASSWORT):
abort(401)
return [json.loads(p.read_text()) for p in sorted(ABLAGE.glob("*.json"))]| Line | Change | Why |
|---|---|---|
| 10 | import send_from_directory |
Flask’s function for serving from a fixed folder |
| 12 | version 1.0.2 | a security update without new features, only the last digit goes up |
| 27–30 | route /.well-known/security.txt |
the sign at the factory gate in the running service;
mimetype="text/plain" as RFC 9116 requires |
| 78–80 | check the number before a path is built | only letters and digits, and the file must exist; otherwise 404 – closes BW-2026-002 |
| 90–91 | send_from_directory(ordner, name) |
checks with safe_join that the path stays inside the
folder; otherwise 404 – closes BW-2026-001 |
Step 2 – put security.txt into the image
too.
# on werk1
nano ~/lotse/Containerfile# Stufe 1: Pakete bauen – pip wird nur hier gebraucht
FROM docker.io/library/python:3.12-slim AS bau
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir --target /app/pakete -r requirements.txt
# Stufe 2: Laufzeit – ohne pip, als eigener Benutzer
FROM docker.io/library/python:3.12-slim
# Debian-Sicherheitskorrekturen, die noch nicht im Grundimage stecken
RUN apt-get update && apt-get upgrade --yes && rm -rf /var/lib/apt/lists/*
RUN pip uninstall --yes pip
WORKDIR /app
COPY --from=bau /app/pakete /app/pakete
COPY app.py security.txt ./
ENV PYTHONPATH=/app/pakete
USER 10001:10001
EXPOSE 8080
CMD ["python", "-m", "gunicorn", "--bind", "0.0.0.0:8080", "--timeout", "300", "--worker-tmp-dir", "/tmp", "app:app"]COPY app.py security.txt ./ copies both files to
/app; the trailing slash says that the target is a
folder.
Step 3 – build, push, record the digest. Exactly as on Day 6:
# on werk1
podman build --pull=always -t werk1:5000/bewerbungslotse:1.0.2 .Expected (excerpt – the new layer and the end):
[2/2] STEP 6/10: COPY app.py security.txt ./
…
[2/2] COMMIT werk1:5000/bewerbungslotse:1.0.2
…
Successfully tagged werk1:5000/bewerbungslotse:1.0.2
The layers before it come from the cache with
Using cache: base image and packages haven’t changed since
Day 6.
# on werk1
podman push --digestfile ~/kurs/07/digest-1.0.2 werk1:5000/bewerbungslotse:1.0.2# on werk1
cat ~/kurs/07/digest-1.0.2Expected (your digest differs – from here on use yours):
sha256:429c03a79bb7f60bd1d778a87e6d60558bbb0c4a18629f353aa0cea91f885d54
Step 4 – seal and verify.
# on werk1
cosign sign --key $HOME/geheim/beispielwerk.key --signing-config $HOME/lotse/signing-config.json --allow-http-registry --yes werk1:5000/bewerbungslotse@sha256:429c03a79bb7f60bd1d778a87e6d60558bbb0c4a18629f353aa0cea91f885d54You know the options from Day 6. Cosign asks for the key’s password
(~/geheim/cosign-passwort).
Expected (excerpt):
Pushing signature to: werk1:5000/bewerbungslotse
# on werk1
cosign verify --key ~/lotse/beispielwerk.pub --insecure-ignore-tlog --allow-http-registry werk1:5000/bewerbungslotse@sha256:429c03a79bb7f60bd1d778a87e6d60558bbb0c4a18629f353aa0cea91f885d54Expected (excerpt): the line
- The signatures were verified against the specified public key.
Step 5 – the chart to 1.0.2.
# on werk1
nano ~/lotse/chart/values.yamllotse:
# Tag zum Lesen, Digest zum Laden: genau das signierte Image
image: werk1:5000/bewerbungslotse:1.0.2@sha256:429c03a79bb7f60bd1d778a87e6d60558bbb0c4a18629f353aa0cea91f885d54
# Pflichtwert, kein Standardpasswort: --set lotse.adminPasswort=…
adminPasswort: ""
service:
# ClusterIP: nur im Cluster erreichbar; NodePort nur bewusst setzen
typ: ClusterIP
nodePort: 30080
speicher: 1Gi
ollama:
image: docker.io/ollama/ollama:0.40.19
modell: qwen3:4b-instruct
knoten: werk1
speicher: 10Gi
# NetworkPolicies: nur der Lotse darf Ollama erreichen
netzwerkregeln: true# on werk1
nano ~/lotse/chart/Chart.yamlapiVersion: v2
name: bewerbungslotse
description: Sortiert Bewerbungen mit einem Sprachmodell vor
type: application
version: 1.0.2
appVersion: "1.0.2"Step 6 – roll out.
# on werk1
helm upgrade lotse ~/lotse/chart -n lotse --set-file lotse.adminPasswort=$HOME/geheim/admin-passwort --wait --timeout 5mExpected (excerpt – revision 9 for you; my history has two more failed attempts):
Release "lotse" has been upgraded. Happy Helming!
STATUS: deployed
REVISION: 11
Step 7 – check the fix, with the attacker’s commands.
# on werk1
curl -s http://10.43.146.193:8080/gesundExpected:
{"status":"ok","version":"1.0.2"}
# on werk1
curl -s -o /dev/null -w "%{http_code}\n" --path-as-is http://10.43.146.193:8080/api/anlagen/../../etc/passwdExpected:
404
Attackers also encode the slash as %2F so that no tool
resolves the dots beforehand. That must fail too:
# on werk1
curl -s -o /dev/null -w "%{http_code}\n" http://10.43.146.193:8080/api/anlagen/..%2F..%2Fetc%2FpasswdExpected:
404
And the legitimate route must keep working:
# on werk1
curl -s -w "\n%{http_code}\n" http://10.43.146.193:8080/api/anlagen/probe1/lebenslauf-mara.txtExpected:
Mara Klein
Lebenslauf
2020-2026 Linux-Administratorin, Stadtwerke Musterstadt
200
Now the upload with ..:
# on werk1
curl -s -o /dev/null -w "%{http_code}\n" --path-as-is -F "datei=@kurs/07/akte-probe.json;filename=probe2.json" http://10.43.146.193:8080/api/bewerbungen/../anlagenExpected:
404
And the sign at the factory gate:
# on werk1
curl -s -i http://10.43.146.193:8080/.well-known/security.txt-ialso shows the response headers.
Expected (excerpt):
HTTP/1.1 200 OK
…
Content-Type: text/plain; charset=utf-8
…
Contact: mailto:[email protected]
Expires: 2027-12-02T23:00:00.000Z
Preferred-Languages: de, en
Policy: https://beispielwerk.example/bewerbungslotse/SECURITY.md
What you see: text/plain; charset=utf-8
– exactly the type RFC 9116 prescribes. Flask added the character set
itself.
Step 8 – remove the traces of the test. The
slipped-in file, the test file and the probe attachments are still in
/daten. They would falsify every export.
# on werk1
kubectl -n lotse exec deploy/lotse -- rm -r /daten/probe.json /daten/probe.txt /daten/anlagen/probe1rm -ralso deletes the folderprobe1with its contents.
# on werk1
kubectl -n lotse exec deploy/lotse -- ls /daten /daten/anlagenExpected (your file numbers differ):
/daten:
270969b6.json
anlagen
b0ef4bd7.json
/daten/anlagen:
Step 9 – legitimate upload, now with a check. A number without an application file is rejected:
# on werk1
curl -s -o /dev/null -w "%{http_code}\n" -F datei=@kurs/00/lebenslauf-mara.txt http://10.43.146.193:8080/api/bewerbungen/probe1/anlagenExpected:
404
With a real number from the list above it works:
# on werk1
curl -s -F datei=@kurs/00/lebenslauf-mara.txt http://10.43.146.193:8080/api/bewerbungen/270969b6/anlagenExpected (with your number):
{"gespeichert":"270969b6/lebenslauf-mara.txt"}
Remember: The fix is only proven when the attacker’s commands fail – in the encoded variant too – and the legitimate route keeps working.
Save your progress? Sign up for free
Drill 5: The papers for 1.0.2
Where you are: on werk1.
What you have afterwards: parts list and VEX for 1.0.2 as signed attestations on the image and a scan with VEX.
A recall is only complete with papers – that is what you learned on Day 6. For 1.0.2 you go through the same steps, this time without explaining the options again.
Step 1 – the parts list.
# on werk1
syft scan registry:werk1:5000/bewerbungslotse@sha256:429c03a79bb7f60bd1d778a87e6d60558bbb0c4a18629f353aa0cea91f885d54 --source-name bewerbungslotse --source-version 1.0.2 -o cyclonedx-json=$HOME/lotse/sbom/bewerbungslotse-1.0.2.cdx.json -o spdx-json=$HOME/lotse/sbom/bewerbungslotse-1.0.2.spdx.json# on werk1
ls -l ~/lotse/sbomExpected (excerpt):
-rw-r--r-- 1 ubuntu ubuntu 981759 Dec 3 12:32 bewerbungslotse-1.0.1.cdx.json
-rw-r--r-- 1 ubuntu ubuntu 2358855 Dec 3 12:32 bewerbungslotse-1.0.1.spdx.json
-rw-r--r-- 1 ubuntu ubuntu 981759 Dec 3 14:36 bewerbungslotse-1.0.2.cdx.json
-rw-r--r-- 1 ubuntu ubuntu 2358855 Dec 3 14:36 bewerbungslotse-1.0.2.spdx.json
What you see: The parts lists of 1.0.1 and 1.0.2 are
exactly the same size in bytes. Only app.py has changed –
your own code, not a package. The parts list lists components, not your
code; the fixed vulnerability is therefore recorded in the VEX.
Step 2 – VEX for 1.0.2. Start with a copy of 1.0.1:
# on werk1
cp ~/lotse/vex/bewerbungslotse-1.0.1.openvex.json ~/lotse/vex/bewerbungslotse-1.0.2.openvex.json# on werk1
nano ~/lotse/vex/bewerbungslotse-1.0.2.openvex.json{
"@context": "https://openvex.dev/ns/v0.2.0",
"@id": "https://beispielwerk.example/vex/bewerbungslotse-1.0.2",
"author": "Beispielwerk GmbH, Produktsicherheit",
"timestamp": "2026-12-03T15:00:00Z",
"version": 1,
"statements": [
{
"vulnerability": {
"name": "GHSA-q34m-jh98-gwm2",
"aliases": [
"CVE-2024-49767"
]
},
"products": [
{
"@id": "pkg:oci/bewerbungslotse@sha256:429c03a79bb7f60bd1d778a87e6d60558bbb0c4a18629f353aa0cea91f885d54?repository_url=werk1:5000/bewerbungslotse",
"subcomponents": [
{
"@id": "pkg:pypi/[email protected]"
}
]
}
],
"status": "fixed",
"status_notes": "Behoben durch Update von Werkzeug 3.0.3 auf 3.1.9.",
"timestamp": "2026-12-03T15:00:00Z"
},
{
"vulnerability": {
"name": "CVE-2026-124709"
},
"products": [
{
"@id": "pkg:oci/bewerbungslotse@sha256:429c03a79bb7f60bd1d778a87e6d60558bbb0c4a18629f353aa0cea91f885d54?repository_url=werk1:5000/bewerbungslotse",
"subcomponents": [
{
"@id": "pkg:deb/debian/[email protected]~deb13u1"
},
{
"@id": "pkg:deb/debian/[email protected]~deb13u1"
},
{
"@id": "pkg:deb/debian/[email protected]~deb13u1"
}
]
}
],
"status": "not_affected",
"justification": "vulnerable_code_not_in_execute_path",
"impact_statement": "Die Lücke betrifft nur QUIC-Server. Der Bewerbungslotse spricht nur HTTP über TCP und nutzt OpenSSL nicht für QUIC.",
"timestamp": "2026-12-03T15:00:00Z"
},
{
"vulnerability": {
"name": "CVE-2025-12781"
},
"products": [
{
"@id": "pkg:oci/bewerbungslotse@sha256:429c03a79bb7f60bd1d778a87e6d60558bbb0c4a18629f353aa0cea91f885d54?repository_url=werk1:5000/bewerbungslotse",
"subcomponents": [
{
"@id": "pkg:generic/[email protected]"
}
]
}
],
"status": "under_investigation",
"status_notes": "Treffer nur über CPE; Prüfung, ob die Korrektur in Python 3.12.16 enthalten ist, läuft.",
"timestamp": "2026-12-03T15:00:00Z"
},
{
"vulnerability": {
"name": "BW-2026-001"
},
"products": [
{
"@id": "pkg:oci/bewerbungslotse@sha256:429c03a79bb7f60bd1d778a87e6d60558bbb0c4a18629f353aa0cea91f885d54?repository_url=werk1:5000/bewerbungslotse"
}
],
"status": "fixed",
"status_notes": "Behoben in 1.0.2: Anlagen werden mit send_from_directory nur aus dem Anlagenordner geliefert.",
"timestamp": "2026-12-03T15:00:00Z"
},
{
"vulnerability": {
"name": "BW-2026-002"
},
"products": [
{
"@id": "pkg:oci/bewerbungslotse@sha256:429c03a79bb7f60bd1d778a87e6d60558bbb0c4a18629f353aa0cea91f885d54?repository_url=werk1:5000/bewerbungslotse"
}
],
"status": "fixed",
"status_notes": "Behoben in 1.0.2: Anlagen nur zu vorhandenen Bewerbungen, Nummer nur aus Buchstaben und Ziffern.",
"timestamp": "2026-12-03T15:00:00Z"
}
]
}- Everywhere the digest of 1.0.2, a new
@idand new timestamps. - The three statements from 1.0.1 remain valid unchanged.
- Two new
fixedstatements for your own vulnerabilities: withoutsubcomponents, because the product itself was affected, not a component. Your numbers serve as names – there is no CVE for them.
Step 3 – attach both as attestations. Cosign asks for the password each time.
# on werk1
cosign attest --key $HOME/geheim/beispielwerk.key --signing-config $HOME/lotse/signing-config.json --allow-http-registry --yes --type cyclonedx --predicate $HOME/lotse/sbom/bewerbungslotse-1.0.2.cdx.json werk1:5000/bewerbungslotse@sha256:429c03a79bb7f60bd1d778a87e6d60558bbb0c4a18629f353aa0cea91f885d54# on werk1
cosign attest --key $HOME/geheim/beispielwerk.key --signing-config $HOME/lotse/signing-config.json --allow-http-registry --yes --type openvex --predicate $HOME/lotse/vex/bewerbungslotse-1.0.2.openvex.json werk1:5000/bewerbungslotse@sha256:429c03a79bb7f60bd1d778a87e6d60558bbb0c4a18629f353aa0cea91f885d54Expected (excerpt, per command):
Using payload from: /home/ubuntu/lotse/vex/bewerbungslotse-1.0.2.openvex.json
# on werk1
cosign tree --allow-http-registry werk1:5000/bewerbungslotse@sha256:429c03a79bb7f60bd1d778a87e6d60558bbb0c4a18629f353aa0cea91f885d54Expected (excerpt – the three kinds of attachments; digests differ):
└── 🔗 https://sigstore.dev/cosign/sign/v1 artifacts via OCI referrer: …
└── 🔗 https://cyclonedx.org/bom artifacts via OCI referrer: …
└── 🔗 https://openvex.dev/ns artifacts via OCI referrer: …
Step 4 – verify the papers and read them, like a customer.
# on werk1
cd ~/kurs/07# on werk1
cosign verify-attestation --key ~/lotse/beispielwerk.pub --insecure-ignore-tlog --allow-http-registry --type openvex werk1:5000/bewerbungslotse@sha256:429c03a79bb7f60bd1d778a87e6d60558bbb0c4a18629f353aa0cea91f885d54 > vex-attestation.jsonExpected (excerpt):
- The signatures were verified against the specified public key.
# on werk1
jq -r '.payload|@base64d|fromjson|.predicate.statements[]|.vulnerability.name + " " + .status' vex-attestation.json.payload|@base64d|fromjsonunpacks the statement as on Day 6..predicate.statements[]goes through every VEX statement;+ " " +joins name and status into one line.
Expected:
GHSA-q34m-jh98-gwm2 fixed
CVE-2026-124709 not_affected
CVE-2025-12781 under_investigation
BW-2026-001 fixed
BW-2026-002 fixed
Step 5 – scan with VEX.
# on werk1
grype registry:werk1:5000/bewerbungslotse@sha256:429c03a79bb7f60bd1d778a87e6d60558bbb0c4a18629f353aa0cea91f885d54 --vex ~/lotse/vex/bewerbungslotse-1.0.2.openvex.json -o json --file ~/lotse/scans/grype-vex-1.0.2.json# on werk1
jq '.matches|length' ~/lotse/scans/grype-vex-1.0.2.jsonExpected:
228
# on werk1
jq '.ignoredMatches|length' ~/lotse/scans/grype-vex-1.0.2.jsonExpected:
3
What you see: The same numbers as for 1.0.1. The scanner doesn’t know your own vulnerabilities – they are in no database. Customers learn that 1.0.2 is better than 1.0.1 only from your VEX and your security advisory.
Remember: Scanners find the suppliers’ defects. The defects of your own design are only in the papers you write yourself.
Save your progress? Sign up for free
Drill 6: The recall letter in CSAF
Where you are: on werk1.
What you have afterwards:
csaf_validatorinstalled, the security advisoryBW-SA-2026-001as a validated CSAF document, the documentation updated, version 1.0.2 committed to the repository and the file closed.
CSAF 2.0 is an OASIS standard. A CSAF document is JSON with three
parts: document (who, what, when),
product_tree (which products) and
vulnerabilities (which vulnerabilities, which products are
affected, how to fix them). The BSI is pushing CSAF forward, and many
large manufacturers publish their advisories this way. Customers
download the documents automatically and match them against their
inventory.
Step 1 – fetch the validator. The project
gocsaf/csaf (version 3.7.1) ships
csaf_validator.
# on werk1
cd ~/werkzeuge# on werk1
curl -sSLO https://github.com/gocsaf/csaf/releases/download/v3.7.1/csaf-3.7.1-gnulinux-amd64.tar.gz-Sshows errors despite-s,-Lfollows GitHub’s redirect,-Osaves under the name from the URL.
The project publishes no checksum file. But on the release page GitHub shows each file’s SHA-256 digest next to it. Compute yours and compare:
# on werk1
sha256sum csaf-3.7.1-gnulinux-amd64.tar.gzExpected:
110052094c1c37282d2b41f2d9e29140ea76c78c9f410c88b1312b6480c9c48d csaf-3.7.1-gnulinux-amd64.tar.gz
The release page shows
sha256:110052094c1c37282d2b41f2d9e29140ea76c78c9f410c88b1312b6480c9c48d
for this file – the same number.
# on werk1
tar -xzf csaf-3.7.1-gnulinux-amd64.tar.gz-xextract,-zdecompress with gzip,-ffrom this file.
# on werk1
ls csaf-3.7.1-gnulinux-amd64/bin-linux-amd64Expected:
csaf_aggregator
csaf_checker
csaf_downloader
csaf_provider
csaf_uploader
csaf_validator
You only need the validator:
# on werk1
sudo install -m 755 csaf-3.7.1-gnulinux-amd64/bin-linux-amd64/csaf_validator /usr/local/bin/# on werk1
csaf_validator --versionExpected:
3.7.1
Step 2 – write the advisory. The file name is
prescribed: the tracking.id in lower case, with
.json.
# on werk1
mkdir ~/lotse/csaf# on werk1
nano ~/lotse/csaf/bw-sa-2026-001.json{
"document": {
"category": "csaf_security_advisory",
"csaf_version": "2.0",
"title": "Bewerbungslotse: Dateien lesen und Akten unterschieben über Anlagen",
"lang": "de",
"publisher": {
"category": "vendor",
"name": "Beispielwerk GmbH",
"namespace": "https://beispielwerk.example"
},
"notes": [
{
"category": "summary",
"text": "Bis Version 1.0.1 liefert GET /api/anlagen/<name> beliebige Dateien des Containers aus, und POST /api/bewerbungen/../anlagen legt Dateien im Datenordner ab. Version 1.0.2 behebt beides."
}
],
"acknowledgments": [
{
"names": ["kiesel"],
"summary": "Meldung von BW-2026-001"
}
],
"tracking": {
"id": "BW-SA-2026-001",
"status": "final",
"version": "1",
"initial_release_date": "2026-12-03T15:00:00.000Z",
"current_release_date": "2026-12-03T15:00:00.000Z",
"revision_history": [
{
"date": "2026-12-03T15:00:00.000Z",
"number": "1",
"summary": "Erstveröffentlichung"
}
]
}
},
"product_tree": {
"branches": [
{
"category": "vendor",
"name": "Beispielwerk GmbH",
"branches": [
{
"category": "product_name",
"name": "Bewerbungslotse",
"branches": [
{
"category": "product_version",
"name": "1.0.0",
"product": {
"product_id": "BL-1.0.0",
"name": "Bewerbungslotse 1.0.0",
"product_identification_helper": {
"purl": "pkg:oci/bewerbungslotse@sha256%3Ab2ff3085f27993b2f1767af32281662fcedf686c9c8340a84485b85295f0e26f?repository_url=werk1:5000/bewerbungslotse"
}
}
},
{
"category": "product_version",
"name": "1.0.1",
"product": {
"product_id": "BL-1.0.1",
"name": "Bewerbungslotse 1.0.1",
"product_identification_helper": {
"purl": "pkg:oci/bewerbungslotse@sha256%3A87e72e42d0ecc84eef601e079b05c0be8b0d979a6f86a30f76d1e2fbb92a657e?repository_url=werk1:5000/bewerbungslotse"
}
}
},
{
"category": "product_version",
"name": "1.0.2",
"product": {
"product_id": "BL-1.0.2",
"name": "Bewerbungslotse 1.0.2",
"product_identification_helper": {
"purl": "pkg:oci/bewerbungslotse@sha256%3A429c03a79bb7f60bd1d778a87e6d60558bbb0c4a18629f353aa0cea91f885d54?repository_url=werk1:5000/bewerbungslotse"
}
}
}
]
}
]
}
]
},
"vulnerabilities": [
{
"ids": [
{
"system_name": "Beispielwerk",
"text": "BW-2026-001"
}
],
"cwe": {
"id": "CWE-22",
"name": "Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')"
},
"notes": [
{
"category": "description",
"text": "GET /api/anlagen/<name> prüft den Pfad nicht. Ohne Anmeldung lassen sich alle Dateien lesen, die der Benutzer 10001 im Container lesen darf, zum Beispiel /etc/passwd und den Quelltext."
}
],
"product_status": {
"known_affected": ["BL-1.0.0", "BL-1.0.1"],
"fixed": ["BL-1.0.2"]
},
"scores": [
{
"products": ["BL-1.0.0", "BL-1.0.1"],
"cvss_v3": {
"version": "3.1",
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N",
"baseScore": 5.3,
"baseSeverity": "MEDIUM"
}
}
],
"remediations": [
{
"category": "vendor_fix",
"details": "Auf Version 1.0.2 aktualisieren: helm upgrade mit Chart 1.0.2.",
"product_ids": ["BL-1.0.0", "BL-1.0.1"]
}
]
},
{
"ids": [
{
"system_name": "Beispielwerk",
"text": "BW-2026-002"
}
],
"cwe": {
"id": "CWE-22",
"name": "Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')"
},
"notes": [
{
"category": "description",
"text": "POST /api/bewerbungen/<nummer>/anlagen nimmt '..' als Nummer an und speichert die Datei dann im Datenordner. Ohne Anmeldung lassen sich so Akten mit erfundener Bewertung unterschieben."
}
],
"product_status": {
"known_affected": ["BL-1.0.0", "BL-1.0.1"],
"fixed": ["BL-1.0.2"]
},
"scores": [
{
"products": ["BL-1.0.0", "BL-1.0.1"],
"cvss_v3": {
"version": "3.1",
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N",
"baseScore": 7.5,
"baseSeverity": "HIGH"
}
}
],
"remediations": [
{
"category": "vendor_fix",
"details": "Auf Version 1.0.2 aktualisieren: helm upgrade mit Chart 1.0.2.",
"product_ids": ["BL-1.0.0", "BL-1.0.1"]
}
]
}
]
}| Part | Field | Meaning |
|---|---|---|
document |
category |
csaf_security_advisory: a security advisory (there is
also e.g. csaf_vex) |
publisher |
who publishes; namespace is your web address |
|
notes (summary) |
short summary for people | |
acknowledgments |
thanks to “kiesel” – as agreed with the researcher | |
tracking |
number, status final, version and revision history;
every correction gets a new revision |
|
product_tree |
branches |
vendor → product → version, each version with a
product_id |
product_identification_helper.purl |
the same identifier as in the VEX: image by digest | |
vulnerabilities |
ids |
your numbers; if the vulnerability had a CVE, it would be in
cve |
cwe |
weakness class CWE-22, path traversal | |
product_status |
known_affected 1.0.0 and 1.0.1, fixed
1.0.2 |
|
scores |
the CVSS vector from Drill 3 with score and severity | |
remediations |
vendor_fix: what the customer should do |
This covers point 4: affected product (product_tree,
product_status), impact (notes), severity
(scores) and help with remediation
(remediations).
Step 3 – validate.
# on werk1
csaf_validator ~/lotse/csaf/bw-sa-2026-001.json
echo $?csaf_validator <file>checks the document against the CSAF 2.0 JSON schema.echo $?shows the validator’s exit code.
Expected (time differs):
2026/12/03 14:35:43 warn: no remote validator specified
"/home/ubuntu/lotse/csaf/bw-sa-2026-001.json" passes the schema validation.
4
What you see: The schema fits. Exit code 4 is still
not an error. The validator sets individual bits: 2 for “schema
violated”, 4 for “no remote validator specified”, 8 for “remote
validation failed”. So 4 only means: nobody has run the standard’s
mandatory tests that go beyond the schema. A validation service
(--validator=<URL>) does that; you meet it in the
Enterprise note. For a pipeline the rule is therefore: bit 2 must never
be set.
Step 4 – update the documentation.
# on werk1
nano ~/lotse/SCHWACHSTELLEN.md# Schwachstellen Bewerbungslotse
Stand: 2026-12-03 · Scanner: Grype 0.122.1 (Datenbank vom 2026-12-03),
Gegenprobe Trivy 0.77.0 · Grundlage: die Images 1.0.0 und 1.0.1 aus der Registry
## Überblick
- 1.0.1: 231 Treffer (Grype): 217 Debian, 0 Python-Pakete,
14 Python-Interpreter; mit VEX 228
- 1.0.0: 266 Treffer (Grype): 220 Debian, 32 Python, 14 Python-Interpreter
- Im KEV-Katalog der CISA (Stand 2026.11.30): keiner
- Höchstes EPSS: CVE-2026-21441 (urllib3), 2,9 %
## Entscheidungen
| Gruppe | Treffer | Entscheidung | Wann |
|---|---|---|---|
| Python-Pakete außer pip | 26 | aktualisiert in 1.0.1 (blinker 1.9.0 für Flask 3.1.3 nötig) | erledigt |
| davon Werkzeug safe_join (nur Windows) | 5 | für 1.0.0: nicht betroffen, VEX | erledigt |
| davon Jinja2-Sandbox (nicht genutzt) | 3 | für 1.0.0: nicht betroffen, VEX | erledigt |
| pip (nur beim Bau gebraucht) | 6 | aus dem Laufzeit-Image entfernt (1.0.1-rc1: 260 Treffer) | erledigt |
| Python-Interpreter (über CPE geraten) | 14 | einzeln prüfen; CVE-2025-12781 in VEX als under_investigation | offen |
| Debian mit Korrektur | 3 | apt-get upgrade im Bau, Grundimage war noch nicht neu | erledigt |
| Debian ohne Korrektur | 217 | Debian-Bewertung übernehmen, Grundimage aktuell halten | laufend |
| davon OpenSSL QUIC CVE-2026-124709 (3 Pakete) | 3 | nicht betroffen, VEX | erledigt |
## VEX
- vex/bewerbungslotse-1.0.0.openvex.json (OpenVEX 0.2.0, 11 Aussagen)
- vex/bewerbungslotse-1.0.1.openvex.json (3 Aussagen: fixed, not_affected,
under_investigation), auch als signierte Attestation am Image
- Produkt jeweils per Digest (1.0.0: b2ff3085…, 1.0.1: 87e72e42…)
- Scan mit VEX nur gegen das Image, nicht gegen die Stückliste
## Betraf uns sicher (behoben in 1.0.1)
- CVE-2024-49767 (Werkzeug 3.0.3, Speicher erschöpfen beim Lesen von
Formulardaten): app.py nimmt Anlagen über request.files an –
erreichbar über POST /api/bewerbungen/<nummer>/anlagen
## Eigene Lücken (behoben in 1.0.2)
| Nummer | Lücke | CVSS 3.1 | Quelle |
|---|---|---|---|
| BW-2026-001 | Dateien lesen über GET /api/anlagen/../ | 5.3 | Meldung „kiesel“ |
| BW-2026-002 | Akten unterschieben über POST mit Nummer .. | 7.5 | eigene Prüfung |
- Betroffen 1.0.0 und 1.0.1, behoben in 1.0.2
- Sicherheitshinweis: csaf/bw-sa-2026-001.json (CSAF 2.0)
- 1.0.2: Grype mit VEX 228 Treffer, 3 ausgeblendet (wie 1.0.1)
## Mindestversionen (Python)
| Paket | 1.0.0 | mindestens | 1.0.1 |
|---|---|---|---|
| certifi | 2024.2.2 | 2026.10.18 | 2026.10.18 |
| flask | 3.0.3 | 3.1.3 | 3.1.3 |
| idna | 3.6 | 3.15 | 3.15 |
| jinja2 | 3.1.4 | 3.1.6 | 3.1.6 |
| requests | 2.31.0 | 2.33.0 | 2.33.0 |
| urllib3 | 2.2.1 | 2.8.0 | 2.8.0 |
| werkzeug | 3.0.3 | 3.1.9 | 3.1.9 |
## Fehlkonfigurationen (trivy config, Stand 1.0.1)
- 1.0.0: 38 Befunde, 1.0.1: 9 Befunde
- Ollama läuft als root (KSV-0012, -0020, -0021): Zulieferer-Image,
akzeptiert für 1.0.1, Umstellung auf Benutzer 10001 geplant
- Ollama ohne CPU-Grenze (KSV-0011): bewusst, das Modell soll alle
freien Kerne nutzen; Speicher ist begrenzt
- Namespace default (KSV-0110): Fehlalarm, das Chart wird mit -n lotse
installiert
- Vertrauenswürdige Registries (KSV-0125): regelt der Betreiber per
Zulassungsregel, nicht das Chart
- Kein HEALTHCHECK im Containerfile (DS-0026): Kubernetes nutzt die
readinessProbe im Chart# on werk1
nano ~/lotse/PRODUKT.md# Produktsteckbrief Bewerbungslotse
## Produkt
- Name: Bewerbungslotse
- Version: 1.0.2 (Image werk1:5000/bewerbungslotse:1.0.2@sha256:429c03a7…,
Chart bewerbungslotse 1.0.2); Vorgänger 1.0.1, 1.0.0
- Hersteller: Beispielwerk GmbH (fiktiv)
- Zweckbestimmung: sortiert Bewerbungen mit einem Sprachmodell vor
(Passung 1 bis 5 mit Begründung)
- Auslieferung: Container-Image und Helm-Chart; wir betreiben es auch selbst
## Einstufung nach CRA
- Produkt mit digitalen Elementen: ja (Software, Art. 3 Nr. 1)
- Rolle: Hersteller (Art. 3 Nr. 13)
- Anhang III (wichtig, Klasse I/II): nein – keine der Kategorien
- Anhang IV (kritisch): nein
- Ergebnis: Standardprodukt, Konformität durch interne Kontrolle
(Modul A, Art. 32 Abs. 1)
## Unterstützungszeitraum (Art. 13 Abs. 8 und 19)
- Inverkehrbringen geplant: 12/2027
- Ende des Unterstützungszeitraums: 12/2032 (fünf Jahre)
- Begründung: Personalsoftware wird typischerweise mehrere Jahre
genutzt; das Grundimage python:3.12-slim (Debian 13) und
Ollama sind Komponenten mit eigenen Lebenszyklen
## Bestandteile (Stand Tag 1)
| Teil | Version | Herkunft |
|---|---|---|
| Programm app.py | 1.0.0 | eigen |
| Python-Pakete | 14 Stück, requirements.txt | PyPI |
| Python | 3.12.16 | Grundimage |
| Debian-Pakete | 87 Stück | Grundimage Debian 13 |
| Ollama | 0.40.19 | docker.io/ollama/ollama |
| Sprachmodell | qwen3:4b-instruct, Apache 2.0 | Ollama-Bibliothek |
## Stückliste (SBOM, Anhang I Teil II Nr. 1)
- sbom/bewerbungslotse-1.0.0.cdx.json (CycloneDX 1.7, Syft 1.57.2)
- sbom/bewerbungslotse-1.0.0.spdx.json (SPDX, Syft 1.57.2)
- sbom/ollama-0.40.19.cdx.json (Zulieferer-Image; Version des
Hauptmoduls fehlt dort, gilt: 0.40.19)
- Erzeugt aus dem Image in der Registry, nicht aus dem Quellordner
- Nicht enthalten: Sprachmodell qwen3:4b-instruct (siehe Bestandteile)
- 1.0.1: sbom/bewerbungslotse-1.0.1.cdx.json und .spdx.json, zusätzlich
als signierte Attestation am Image
## Signatur und Nachweise (ab 1.0.1)
- Image per Digest signiert mit Cosign, Schlüssel des Werks
- Öffentlicher Schlüssel: beispielwerk.pub (liegt diesem Repository bei)
- Am Image hängen: Signatur, Stückliste (CycloneDX), VEX (OpenVEX)
- Kein öffentliches Transparenzlog: signing-config.json ohne Dienste;
prüfen mit cosign verify --key beispielwerk.pub --insecure-ignore-tlog
- Privater Schlüssel und Passwort nur beim Hersteller, nie im Repository
## Anlaufstelle für Sicherheitsmeldungen (Art. 13 Abs. 17)
- [email protected], Konzept in SECURITY.md
- security.txt im Repository und im Dienst unter
/.well-known/security.txt (ab 1.0.2)
- Vertrauliche Meldungen nur außerhalb des Repositorys
## Angriffsfläche (Stand Tag 5, Version 1.0.1)
| Schnittstelle | Erreichbar von | Schutz |
|---|---|---|
| Service lotse :8080 (ClusterIP) | im Cluster und vom Knoten | NodePort nur, wenn der Betreiber ihn setzt |
| /api/admin/export | wie oben | Passwort Pflicht, kein Standardwert; ohne Passwort abgeschaltet |
| Ollama :11434 | nur Pods mit app=lotse | NetworkPolicy |
## Sichere Standardkonfiguration (Anhang I Teil I Nr. 2 b)
- Kein Standardpasswort: Helm bricht ohne lotse.adminPasswort ab
- Service vom Typ ClusterIP statt NodePort
- NetworkPolicies: alles zu, nur Lotse → Ollama und Port 8080 zum Lotsen
- Lotse: Benutzer 10001, kein root, keine Rechteausweitung, alle
Capabilities entfernt, Dateisystem nur lesbar, Seccomp RuntimeDefault,
kein Service-Account-Token, CPU/Speicher begrenzt
- Laufzeit-Image ohne pip (mehrstufiger Bau)
- Akten auf einem PersistentVolume statt emptyDir
- Prüfung: trivy config mit --helm-set, Befunde siehe SCHWACHSTELLEN.md
- Zurücksetzen auf die Werkseinstellungen: helm upgrade mit
--reset-values (nur das Passwort neu angeben)
## Offene Punkte
- Ollama läuft als root (Zulieferer-Image); als Benutzer 10001
getestet, braucht HOME auf eigenem Volume und neu geladenes Modell
- keine Zugriffs- und Entscheidungsprotokolle
- keine Verschlüsselung zwischen Lotse und Ollama (nur im Cluster)The new section “Anlaufstelle” is your evidence for Article 13(17) and Annex II, point 2.
Step 5 – commit 1.0.2. The notification file stays outside; everything else goes in.
# on werk1
cd ~/lotse# on werk1
git add app.py Containerfile chart csaf sbom vex scans PRODUKT.md SCHWACHSTELLEN.md# on werk1
git commit -m "1.0.2: BW-2026-001 und BW-2026-002 behoben, Sicherheitshinweis als CSAF"Expected (excerpt – your commit number differs):
[main 85575a8] 1.0.2: BW-2026-001 und BW-2026-002 behoben, Sicherheitshinweis als CSAF
11 files changed, 309 insertions(+), 9 deletions(-)
create mode 100644 csaf/bw-sa-2026-001.json
# on werk1
git tag v1.0.2Step 6 – close the file. With the published advisory, the embargo ends. The file is kept as evidence of how you handled the report.
# on werk1
nano ~/meldungen/BW-2026-001.md# BW-2026-001 – vertraulich bis zur Veröffentlichung
## Eingang
- Eingegangen: 2026-12-03 14:00 über [email protected]
- Von: „kiesel“ (Pseudonym), möchte im Hinweis genannt werden
- Eingangsbestätigung: 2026-12-03 14:20 (Frist 3 Werktage)
## Meldung (wörtlich)
> Der Bewerbungslotse 1.0.1 liefert über GET /api/anlagen/<name>
> beliebige Dateien des Containers aus. Nachstellen:
> curl --path-as-is http://<lotse>:8080/api/anlagen/../../etc/passwd
> Ich habe nur meine eigene Testinstallation geprüft.
> Veröffentlichung von meiner Seite frühestens in 90 Tagen.
## Nachstellung
- 2026-12-03 nachgestellt auf 1.0.1: /etc/passwd und /app/app.py lesbar
- Klappt erst, wenn es mindestens eine Anlage gibt (sonst 500)
- Nicht lesbar: /proc/self/environ (leer), Service-Account-Token
(nicht eingehängt, Tag 5)
- Beim Prüfen gefunden: Upload mit Nummer ".." schreibt nach /daten
und kann Akten unterschieben → eigene Nummer BW-2026-002
## Bewertung
| Nummer | Lücke | CVSS 3.1 | Wert |
|---|---|---|---|
| BW-2026-001 | Datei lesen (Download) | AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N | 5.3 mittel |
| BW-2026-002 | Akte schreiben (Upload) | AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N | 7.5 hoch |
- Betroffen: 1.0.0 und 1.0.1
- Aktiv ausgenutzt: nicht bekannt (sonst Meldung nach Art. 14, Tag 8)
- Entscheidung: Sicherheitsupdate 1.0.2, danach Hinweis als CSAF
## Abschluss
- 2026-12-03 behoben in 1.0.2 (Image 429c03a7…, signiert)
- 2026-12-03 15:00 Sicherheitshinweis BW-SA-2026-001 veröffentlicht
- „kiesel“ informiert und im Hinweis genannt
- Status: geschlossenRemember: The recall letter has two readers: people read
notesandremediations, machines matchproduct_treeandproduct_statusagainst their inventory. The validator makes sure that the machines can actually read it.
Save your progress? Sign up for free
Diagnosis task
Situation: A colleague is preparing a second revision of the advisory and first experiments on a copy. Afterwards she says: “The validator returns 6, that’s just 4 plus something.” Reproduce it:
# on werk1
cp ~/lotse/csaf/bw-sa-2026-001.json ~/kurs/07/kaputt.json# on werk1
nano ~/kurs/07/kaputt.jsonChange only line 26, the status:
{
"document": {
"category": "csaf_security_advisory",
"csaf_version": "2.0",
"title": "Bewerbungslotse: Dateien lesen und Akten unterschieben über Anlagen",
"lang": "de",
"publisher": {
"category": "vendor",
"name": "Beispielwerk GmbH",
"namespace": "https://beispielwerk.example"
},
"notes": [
{
"category": "summary",
"text": "Bis Version 1.0.1 liefert GET /api/anlagen/<name> beliebige Dateien des Containers aus, und POST /api/bewerbungen/../anlagen legt Dateien im Datenordner ab. Version 1.0.2 behebt beides."
}
],
"acknowledgments": [
{
"names": ["kiesel"],
"summary": "Meldung von BW-2026-001"
}
],
"tracking": {
"id": "BW-SA-2026-001",
"status": "fertig",
"version": "1",
"initial_release_date": "2026-12-03T15:00:00.000Z",
"current_release_date": "2026-12-03T15:00:00.000Z",
"revision_history": [
{
"date": "2026-12-03T15:00:00.000Z",
"number": "1",
"summary": "Erstveröffentlichung"
}
]
}
},
"product_tree": {
"branches": [
{
"category": "vendor",
"name": "Beispielwerk GmbH",
"branches": [
{
"category": "product_name",
"name": "Bewerbungslotse",
"branches": [
{
"category": "product_version",
"name": "1.0.0",
"product": {
"product_id": "BL-1.0.0",
"name": "Bewerbungslotse 1.0.0",
"product_identification_helper": {
"purl": "pkg:oci/bewerbungslotse@sha256%3Ab2ff3085f27993b2f1767af32281662fcedf686c9c8340a84485b85295f0e26f?repository_url=werk1:5000/bewerbungslotse"
}
}
},
{
"category": "product_version",
"name": "1.0.1",
"product": {
"product_id": "BL-1.0.1",
"name": "Bewerbungslotse 1.0.1",
"product_identification_helper": {
"purl": "pkg:oci/bewerbungslotse@sha256%3A87e72e42d0ecc84eef601e079b05c0be8b0d979a6f86a30f76d1e2fbb92a657e?repository_url=werk1:5000/bewerbungslotse"
}
}
},
{
"category": "product_version",
"name": "1.0.2",
"product": {
"product_id": "BL-1.0.2",
"name": "Bewerbungslotse 1.0.2",
"product_identification_helper": {
"purl": "pkg:oci/bewerbungslotse@sha256%3A429c03a79bb7f60bd1d778a87e6d60558bbb0c4a18629f353aa0cea91f885d54?repository_url=werk1:5000/bewerbungslotse"
}
}
}
]
}
]
}
]
},
"vulnerabilities": [
{
"ids": [
{
"system_name": "Beispielwerk",
"text": "BW-2026-001"
}
],
"cwe": {
"id": "CWE-22",
"name": "Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')"
},
"notes": [
{
"category": "description",
"text": "GET /api/anlagen/<name> prüft den Pfad nicht. Ohne Anmeldung lassen sich alle Dateien lesen, die der Benutzer 10001 im Container lesen darf, zum Beispiel /etc/passwd und den Quelltext."
}
],
"product_status": {
"known_affected": ["BL-1.0.0", "BL-1.0.1"],
"fixed": ["BL-1.0.2"]
},
"scores": [
{
"products": ["BL-1.0.0", "BL-1.0.1"],
"cvss_v3": {
"version": "3.1",
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N",
"baseScore": 5.3,
"baseSeverity": "MEDIUM"
}
}
],
"remediations": [
{
"category": "vendor_fix",
"details": "Auf Version 1.0.2 aktualisieren: helm upgrade mit Chart 1.0.2.",
"product_ids": ["BL-1.0.0", "BL-1.0.1"]
}
]
},
{
"ids": [
{
"system_name": "Beispielwerk",
"text": "BW-2026-002"
}
],
"cwe": {
"id": "CWE-22",
"name": "Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')"
},
"notes": [
{
"category": "description",
"text": "POST /api/bewerbungen/<nummer>/anlagen nimmt '..' als Nummer an und speichert die Datei dann im Datenordner. Ohne Anmeldung lassen sich so Akten mit erfundener Bewertung unterschieben."
}
],
"product_status": {
"known_affected": ["BL-1.0.0", "BL-1.0.1"],
"fixed": ["BL-1.0.2"]
},
"scores": [
{
"products": ["BL-1.0.0", "BL-1.0.1"],
"cvss_v3": {
"version": "3.1",
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N",
"baseScore": 7.5,
"baseSeverity": "HIGH"
}
}
],
"remediations": [
{
"category": "vendor_fix",
"details": "Auf Version 1.0.2 aktualisieren: helm upgrade mit Chart 1.0.2.",
"product_ids": ["BL-1.0.0", "BL-1.0.1"]
}
]
}
]
}# on werk1
csaf_validator ~/kurs/07/kaputt.json
echo $?Expected (time differs):
2026/12/03 14:35:51 warn: no remote validator specified
schema validation errors of "/home/ubuntu/kurs/07/kaputt.json"
* /document/tracking/status: value must be one of 'draft', 'final', 'interim'
2026/12/03 14:35:51 /home/ubuntu/kurs/07/kaputt.json: filename kaputt.json does not match document/tracking/id "BW-SA-2026-001".
6
Your task: What does the 6 mean? Which messages are real errors, and what does the colleague have to change?
Solution path:
- Break the 6 down into bits: 6 = 2 + 4. You know the 4 (no remote validator). The 2 means: schema violated – the document is useless for machines.
- The first message names the location as a JSON path:
/document/tracking/statusmay only bedraft,finalorinterim. “fertig” is not CSAF. - The second message is a rule of its own in the standard: the file
name must match the
tracking.id.kaputt.jsondoesn’t matchBW-SA-2026-001. For a working copy that doesn’t matter; onlybw-sa-2026-001.jsonmay be published. - For a new revision, the colleague sets the status back to
final, raisestracking.versionto2, adds number2with date and reason torevision_historyand setscurrent_release_dateto the same date.
Remember: You read an exit code made of bits by breaking it down. With
csaf_validator, 2 is the bit that must stop a publication.
Challenge
Task: Prove two statements for the advisory with the source code instead of from memory:
- Is there still a place in 1.0.2 that builds a path from the request without checking it?
- Is 1.0.0 really affected, as the advisory says?
Try it yourself first. A hint: every path in the Lotse starts with
ABLAGE.
Solution:
# on werk1
grep -n "ABLAGE" ~/lotse/app.pyExpected:
15:ABLAGE = Path(os.environ.get("ABLAGE", "/daten"))
64: (ABLAGE / f"{akte['nummer']}.json").write_text(json.dumps(akte, ensure_ascii=False))
70: akte = ABLAGE / f"{nummer}.json"
79: if not nummer.isalnum() or not (ABLAGE / f"{nummer}.json").exists():
82: ordner = ABLAGE / "anlagen" / nummer
91: return send_from_directory(ABLAGE / "anlagen", name)
101: return [json.loads(p.read_text()) for p in sorted(ABLAGE.glob("*.json"))]
| Line | Path from | Assessment |
|---|---|---|
| 64 | akte['nummer'] |
generated by the Lotse itself (uuid4), not from
outside |
| 70 | nummer |
only used after isalnum() and exists()
(line 71) |
| 79, 82 | nummer |
newly checked in 1.0.2 |
| 91 | name |
send_from_directory checks itself |
| 101 | nothing from outside | glob over the fixed folder |
No open spot left. Now 1.0.0 – Git keeps every version:
# on werk1
git -C ~/lotse show v1.0.0:app.py > ~/kurs/07/app-1.0.0.pyshow v1.0.0:app.pyprints the file as it was in the commit with the tagv1.0.0.
# on werk1
grep -n "ABLAGE" ~/kurs/07/app-1.0.0.pyExpected:
14:ABLAGE = Path(os.environ.get("ABLAGE", "/daten"))
56: (ABLAGE / f"{akte['nummer']}.json").write_text(json.dumps(akte, ensure_ascii=False))
62: akte = ABLAGE / f"{nummer}.json"
71: ordner = ABLAGE / "anlagen" / nummer
79: return send_file(ABLAGE / "anlagen" / name)
87: return [json.loads(p.read_text()) for p in sorted(ABLAGE.glob("*.json"))]
What you see: Line 71 builds the folder from the
unchecked number (BW-2026-002), line 79 serves with
send_file without a check (BW-2026-001) – the same code as
in 1.0.1. 1.0.0 is affected, the advisory is correct.
Save your progress? Sign up for free
Checkpoint
# on werk1
curl -s http://10.43.146.193:8080/gesundExpected:
{"status":"ok","version":"1.0.2"}
# on werk1
curl -s -o /dev/null -w "%{http_code}\n" --path-as-is http://10.43.146.193:8080/api/anlagen/../../etc/passwdExpected:
404
# on werk1
curl -s -o /dev/null -w "%{http_code}\n" --path-as-is -F datei=@kurs/00/lebenslauf-mara.txt http://10.43.146.193:8080/api/bewerbungen/../anlagenExpected:
404
# on werk1
curl -s http://10.43.146.193:8080/.well-known/security.txtExpected:
Contact: mailto:[email protected]
Expires: 2027-12-02T23:00:00.000Z
Preferred-Languages: de, en
Policy: https://beispielwerk.example/bewerbungslotse/SECURITY.md
# on werk1
csaf_validator ~/lotse/csaf/bw-sa-2026-001.json
echo $?Expected (excerpt):
passes the schema validation. and the exit code
4.
# on werk1
ls -ld ~/meldungenExpected (excerpt): drwx------.
# on werk1
git -C ~/lotse tagExpected:
v1.0.0
v1.0.1
v1.0.2
# on werk1
helm list -n lotseExpected (excerpt – the columns STATUS, CHART and APP VERSION):
deployed bewerbungslotse-1.0.2 1.0.2
Test yourself
- Why doesn’t the notification file belong in the repository
~/lotse? - The colleague reports “not reproducible, 404”. What do you check first?
- Why did you examine not only the download but also the upload – and what was the result?
- Why does the fix for BW-2026-001 not show up in any Grype scan?
- What information does Annex I, Part II, point 4 CRA require, and where is it in the CSAF document?
csaf_validatorends with 4. May the advisory be published?
Answers:
- As long as there is no fix, the report is an attack guide. A
repository is shared, mirrored and published at some point; the file
therefore lies outside it, in a folder with permissions
700. - What was really sent (
curl -v): without--path-as-is,curlresolves../itself. Then reproduce the command literally and read the log on a 500. - Because the same defect – a path from the request – can be hiding
wherever paths are built (variant analysis). The file name was safe
(
Path(…).name), the number was not:..put files into/datenand allowed application files to be slipped in (BW-2026-002, CVSS 7.5). - Scanners only know published vulnerabilities in components (CVE, GHSA). Bugs in your own code with your own number are in no database – customers learn about them only through VEX and the security advisory.
- The affected product (
product_tree,product_status), the impacts (notes), the severity (scoreswith CVSS) and help with remediation (remediations). - Yes, as far as the schema is concerned: 4 only means that no remote validator was specified; bit 2 (schema violated) is not set. The standard’s additional mandatory tests should nevertheless be run by a validation service before publication.
Interview note
“What happens at your company when someone reports a security
vulnerability?” – A good answer: there is a point of contact
(security@, security.txt,
SECURITY.md with deadlines and safe harbor). The report
goes confidentially into a file, we acknowledge receipt, reproduce, look
for variants and assess with CVSS. Then come the fix, a signed update
and a security advisory as CSAF; we agree the publication with the
reporter. If the vulnerability is actively exploited, the reporting
deadlines under Article 14 CRA run in addition. If you want to go
further, mention CVE assignment through a CNA and the standards ISO/IEC
29147 (disclosure) and 30111 (handling).
Enterprise note
In a company there is a PSIRT (Product Security Incident Response
Team) for this, with on-call duty, a ticket system with restricted
access for the files and encrypted communication (OpenPGP key, in
security.txt via the field Encryption:). For
its own vulnerabilities the factory becomes a CNA (CVE Numbering
Authority) itself or has CVEs assigned through another CNA. CSAF
advisories are published as a CSAF Provider: a
provider-metadata.json under
/.well-known/csaf/, signed documents with checksums, also
discoverable via a CSAF: field in
security.txt. With csaf_checker you check
whether your own provider meets the requirements; with
csaf_downloader customers download all advisories
automatically. For the mandatory tests beyond the schema you run a
validation service (for example the one from Secvisogram) and specify it
with --validator. Bug bounty programmes, which recital 76
explicitly mentions, additionally reward reporters.
Summary
SECURITY.mddescribes the policy for coordinated disclosure,security.txt(RFC 9116) names the point of contact in machine-readable form; since 1.0.2 the Lotse serves it under/.well-known/.- Reports stay in a confidential file outside the repository until publication.
curlresolves../itself; only--path-as-isreproduces the report. A 500 was the real vulnerability with a missing folder.- The hardening from Day 5 limited the damage: no token, no environment readable.
- The variant analysis found a second, more serious vulnerability in the upload (BW-2026-002, CVSS 7.5).
- 1.0.2 fixes both with
send_from_directoryand a check of the number, signed, with parts list and VEX as attestations. - The security advisory
BW-SA-2026-001is a CSAF 2.0 document;csaf_validatorchecks the schema, the exit code is a bitmask.
Commands at a glance
| Command | Purpose |
|---|---|
mkdir -m 700 <folder> |
create a folder only for you |
curl --path-as-is <url> |
send a path with ../ unchanged |
curl -v -s -o /dev/null <url> |
see what was really sent |
curl -F "datei=@<file>;filename=<name>" <url> |
upload a file, set the file name yourself |
curl -w "%{http_code} %{size_download}\n" <url> |
print status and size of the response |
kubectl -n <ns> logs deploy/<name> --tail=<n> |
last log lines of a Deployment |
kubectl -n <ns> exec deploy/<name> -- <command> |
run a command in the pod |
git show <tag>:<file> |
print a file from an earlier version |
csaf_validator <file> |
check a CSAF document against the schema |
echo $? |
exit code of the last command |