AWS re:Invent happy hour: Dec 1, 6 PM PST at MGM Grand RSVP

Two versions of the same API response side by side. Both return 201, and four fields differ after a Python security patch.

How to Test a Runtime Security Patch with Recorded Traffic


Three language runtimes shipped emergency security releases inside four weeks this fall. PHP on October 21, for two remote code execution bugs that CISA told organizations to patch immediately. OpenJDK on November 17, for a memory-corruption bug in its Base64 decoder. Ruby on November 18, for seven flaws in its regex engine and string case conversion.

The advice was the same each time: update now. But the security fix arrives inside a whole release. PHP’s also carried a separate engine bug fix, and that one crashed 8.4.27 and 8.5.12 with zend_mm_heap corrupted on SimpleXML code that ran fine on 8.4.26. A user reported it the day the release shipped, and the fix was merged the next day. Five days later, Tenable noted that it still hadn’t shipped in a release.

A crash is the easy kind to catch, because something falls over. The harder kind keeps returning success codes. We don’t have a case like that from this fall’s releases. The best documented one is older: Python 3.12.6, from September 2024, fixed CVE-2023-27043 by making email.utils.parseaddr reject malformed inputs by default. We applied that one-line image bump to a small service and replayed support-inbox requests at it, including four sender formats we picked because the stricter parser handles them differently. All four responses changed, every one of them still returned 201, and the unit tests passed on both versions.

This post walks through the check that shows it. proxymock replays traffic the service has already handled against the patched image, with its dependencies mocked from the same recording, and compares every response field. It ran in about six seconds on a laptop, with no staging environment.

🎯 Key Takeaways
  • The JDK update carrying the November 17 OpenJDK fix passed in about 30 seconds: all 700 replayed requests matched the recording.
  • On a Python security patch (3.12.6, September 2024), the four tickets whose sender format the patch handles differently all changed. All four still returned 201, and unit tests passed.
  • A gate on status codes passes that Python patch. So does a response schema check. A field-by-field comparison fails it.
  • Nothing else has to be running, because dependencies are answered from the recording, and the same command runs as a pull-request gate on any change to the Dockerfile.
flowchart LR
    R[Recording<br/>requests and dependency calls] --> M[proxymock mock<br/>answers the dependencies]
    R --> P[proxymock replay<br/>sends the requests]
    M --> A[Patched image]
    P --> A
    A --> V[Every response field compared]
    V --> O[Exit 0 or 1]

Set up

You need Git, Docker, jq and proxymock on your PATH. proxymock is a free CLI. The first time, proxymock init opens a browser sign-in. It keeps its config and a local CA certificate under ~/.speedscale/, and the demo mounts that certificate into the app container so proxymock can answer the app’s HTTPS calls.

We ran everything below on November 23, 2026 with proxymock v2.5.1453 on Docker Desktop for Mac (Apple Silicon). On Linux the script uses the host network in place of host.docker.internal.

git clone https://github.com/speedscale/demo
cd demo/python

Keep ports 5001 and 4140 free.

The service is a small Flask app. POST /tickets is a support-inbox webhook: it parses the From header with parseaddr and returns the parsed sender, a routing queue and whether an auto-reply goes out. The recording in proxymock/recording/ holds 14 inbound requests, 11 of them tickets, and the Hugging Face and OpenRouter calls the app made while serving them.

We wrote that traffic for the demo. Seven tickets use ordinary addresses. The other four use sender formats we picked because Python 3.12.6 parses them differently: two Outlook-style names like Doe, John <john.doe@example.net>, one From header with two addresses, and one address with an IP literal for its domain, ops@[192.0.2.10], which is valid email syntax. With your own service you’d record real traffic, which is covered below.

Check the image you run today

make fast-lane

This builds the image pinned in the Dockerfile, python:3.12.5-slim, and runs fast-lane-check.sh against it. The script comes down to three commands:

proxymock mock --in proxymock/recording --no-passthrough --out "$RUN/mocked"

docker run -d --name fast-lane-check -p 5001:5001 \
  -e HTTP_PROXY=http://host.docker.internal:4140 \
  -e HTTPS_PROXY=http://host.docker.internal:4140 \
  -e REQUESTS_CA_BUNDLE=/certs/tls.crt \
  -v ~/.speedscale/certs/tls.crt:/certs/tls.crt:ro \
  fast-lane-demo:candidate

proxymock replay --in proxymock/recording \
  --test-against http://localhost:5001 \
  --test-config security-patch --spec openapi.yaml \
  --mocks-out "$RUN/mocked" --out "$RUN/replayed" \
  --output pretty

proxymock mock answers the app’s outbound calls from the recording on port 4140. --no-passthrough means a call with no recorded answer fails, so the app can’t quietly reach the real Hugging Face or OpenRouter. proxymock replay sends the 14 recorded requests and scores each response against the recorded one. The rules for that scoring live in a test config, here proxymock/testconfigs/security-patch.json.

The end of our output, trimmed to the lines that decide the result:

TEST CONFIG GOALS (security-patch)
 PASS passAssertPct >= 100 - observed 100
 56 assertions over 14 replayed requests: 56 passed, 0 failed
READINESS
 A    Regression      blocks below A    100% pass
 A    Spec adherence  blocks below B    100% conform
 A    Mock fidelity   blocks below A    100% matched
Readiness verdict: READY
Goal verdict: PASS

The command exited 0. Each request gets four checks (status, content type, headers, body), which is where 56 comes from. The letter grades are proxymock’s readiness scorecard. Regression is the response comparison, Spec adherence checks responses against openapi.yaml, and Mock fidelity confirms every outbound call found a recorded answer. In this test config any of the three can fail the run.

This is the baseline, and it should pass, since the recording came from this image.

Apply the patch

make fast-lane-patched

Same app, same recording, same three commands. The only change is the base image, python:3.12.6-slim.

TEST CONFIG GOALS (security-patch)
 FAIL passAssertPct >= 100 - observed 92.86
 56 assertions over 14 replayed requests: 52 passed, 4 failed
READINESS
 D    Regression      blocks below A    92.86% pass
 A    Spec adherence  blocks below B    100% conform
 A    Mock fidelity   blocks below A    100% matched
 - Bring Regression from D to A: 92.86% pass now, A at >= 99.5%.
Readiness verdict: NOT READY
Goal verdict: FAIL (includes the readiness verdict: Not ready)

The command exited 1. Four tickets came back different. The script then prints the changed lines for each one with proxymock files compare -vv. Here’s the ticket from ops@[192.0.2.10]:

# response body
lines 2-3:
< "auto_reply": true,
< "queue": "general",
> "auto_reply": false,
> "queue": "needs-review",

lines 5-6:
< "domain": "[192.0.2.10]",
< "email": "ops@[192.0.2.10]",
> "domain": null,
> "email": "",

line 12:
< "valid_sender": true
> "valid_sender": false

On 3.12.5 that sender went to the general queue and got an auto-reply. On 3.12.6 the address parses as empty, so the ticket lands in needs-review and no reply goes out. The ticket with two addresses in its From header changed the same way. Both responses are still 201.

Spec adherence stayed at A, because the changed responses have the right shape. valid_sender is still a boolean and queue is still one of the allowed values.

Decide what the diff means

The patch still ships. Python 3.12.6 closes a real hole, and NOT READY here is a verdict on the pull request as it stands. What the diff tells you is what has to ship with the patch.

Two of the four changes are the routing change above, which is customer-facing: those senders stop getting an auto-reply. The other two are the Outlook-style senders. Python 3.12.5 parsed those as the address doe, which was already wrong, and the tickets were already in needs-review. The patch turns that wrong answer into an empty one.

So the options are concrete. Handle the empty result in the app and ship that change in the same pull request. Or accept the new routing and re-record, so the recording matches the behavior you chose. Passing strict=False gets the old parsing back, along with the exposure the patch closed. That call belongs to the team that owns the service, and with the changed fields already on the screen it fits inside a patch deadline.

What a status check misses

We replayed the same recording against the patched image twice more, with weaker gates.

A status gate, proxymock replay --fail-if "requests.failed != 0", passed with zero failed requests. Every response was a 201.

proxymock’s built-in regression test config passed too, with 56 of 56 assertions. It checks each response against the recorded schema, and the schema didn’t change.

The security-patch test config is stricter in one place. It uses httpResponseBody, which compares every field’s value with the recording:

"configs": [
  { "type": "httpStatusCode" },
  { "type": "httpResponseBody", "config": { "allowNew": "false" } },
  { "type": "httpOutput", "config": { "mockRequired": "huggingface.co,openrouter.ai" } }
]

httpOutput also requires the app’s outbound calls to match the recording. This is differential testing with the recording standing in for the old build, graded on the same readiness scorecard a Speedscale cloud replay gets.

A JDK update that changed nothing

The same repo has a Spring Boot auth service backed by MySQL. Its recording holds 35 inbound requests and the 480 MySQL calls behind them.

cd ../java-auth
make fast-lane

This builds the service on the Corretto 21.0.12 and 21.0.13 image tags and replays the recording 20 times against each, with MySQL mocked. At run time the two images reported 21.0.12.1 (dated August 18) and 21.0.13.1 (November 17), so the comparison covers everything between those builds. The newer image is Corretto 21.0.13.1.2, and builds from 21.0.13.1 on carry the fix for CVE-2026-114938.

candidate: openjdk version "21.0.13.1" 2026-11-17 LTS

Did functionality break?   PASS  2660 of 2660 assertions match the recording
Did performance regress?   PASS  p95 10.7 ms deployed, 9.1 ms candidate (-15%, budget +50%)

The command exited 0. That’s 35 requests replayed 20 times, 700 in all. Every response on the newer JDK matched, and every MySQL call the app made had a recorded answer.

We ran eight other one-line changes on this service the same way on November 18, from JDK 21 to 25 to a MySQL driver bump. The java-auth README has the table. All of them matched on these 35 requests, which says more about a patch release than about a major-version jump.

Caveat I owe you: this run doesn’t exercise the CVE. The vulnerable decoder needs an x86-64 CPU with AVX-512 VBMI, and we ran on an Apple Silicon laptop. This service also never calls java.util.Base64. Its JWT and JSON libraries decode Base64 with their own code. A scanner flags the JDK anyway, the patch still has to ship, and the check shows the newer runtime serves the same responses.

Run it on your own service

Record first. From the directory of the service you want to check:

proxymock record --app-port 5001 --out proxymock/recording -- python app.py

proxymock starts your app, listens on port 4143 in front of it, and writes each inbound request, its response and every outbound call as a file under proxymock/recording/. Send your traffic to 4143. A database is recorded with --map, for example --map 65432=postgres://localhost:5432. Point the app’s database URL at port 65432 while you record, and at the same port when the check mocks it. The Java demo does this for MySQL.

The demo hands proxymock’s CA certificate to Python with REQUESTS_CA_BUNDLE. In a Linux container, Go reads SSL_CERT_FILE and Node reads NODE_EXTRA_CA_CERTS. The language reference covers the proxy settings for each.

If the service runs on Kubernetes, you can capture there. With the Speedscale operator installed, the cluster tutorial turns on eBPF capture for one workload and pulls the recording into the same directory layout.

Then copy fast-lane-check.sh and proxymock/testconfigs/security-patch.json from the demo, and expect two things.

Some fields change on every run: timestamps, generated IDs, tokens. A compare-every-field check fails on those until you tell it to skip them. The Java demo does it with one setting:

{
  "type": "httpResponseBody",
  "config": { "allowNew": "false", "ignore": "accessToken,refreshToken,timestamp" }
}

A recording holds whatever the service saw, including headers, bodies, tokens and query results. The recordings in the demo repo contain only test accounts and tokens we made up. Real traffic needs redacting before you commit it. proxymock record --dlp-config redacts at capture time, and proxymock dlp test reports what a rule set would redact from files you already have. Both run on your machine. The DLP guide covers the rules.

LLM prompt to set this up on your own service
Read https://speedscale.com/blog/test-runtime-security-patch-recorded-traffic/ and this project's own instructions first. Find how this service starts, which port it listens on, and which HTTP services and databases it calls. Record it with proxymock record, using --app-port for the inbound port and --map for any database, and ask me to send traffic or point you at a script that does. Tell me which recorded headers, bodies or query results look like credentials or personal data before anything is committed. Then copy fast-lane-check.sh and proxymock/testconfigs/security-patch.json from https://github.com/speedscale/demo/tree/master/python, adapt the image name, ports and environment variables, and run the check against the image we run today. List any response fields that differ on that baseline run and propose an ignore list for the ones that change on every run. Check each proxymock command's --help before adapting it. Report the commands you ran, the verdict, and anything you could not verify.

Run it on every pull request

The check is one script with an exit code, so it drops into CI. The demo repo runs it on GitHub Actions, after a Trivy scan, for any pull request that touches the Dockerfile, the dependencies or the recording. A dependency bot’s base-image bump then shows up with either a pass or a list of changed fields on it.

To watch it fail, open a pull request that changes the Python base image to python:3.12.6-slim. Re-record when you change the API on purpose, because the check compares against whatever the recording holds.

Limits

  • The replay covers the recorded requests only. An endpoint or an input the recording never sends isn’t checked. On the PHP crash above, a replay would have shown failed requests only if the recorded traffic reached that SimpleXML path.
  • We haven’t run the PHP or Ruby releases through this check. proxymock works at the network level, so the commands don’t change with the language, but we only have results for Python and Java.
  • It tests one service. Its dependencies are held fixed by the mock, so a change on the other side of a call isn’t covered.
  • The check compares with what the deployed build returned, bugs included. The Doe, John tickets were wrong before the patch.
  • Both recordings were written for the demo. Production traffic has more of the odd inputs that a patch like this one changes.
  • proxymock doesn’t scan the image. Rescan the rebuilt image with your own scanner.

Frequently asked questions

How do I test a runtime security patch without a full environment?

Record the service's traffic once with proxymock. Then run proxymock mock to answer its dependencies from that recording, start the patched image against the mock, and run proxymock replay to send the recorded requests and compare every response with the recorded one. No staging environment or live dependency is needed.

Why didn't unit tests or status checks catch the Python patch?

The unit tests never sent the sender formats the stricter parser rejects, and every changed response still returned 201 with the right shape. Only a field-by-field comparison with recorded responses showed that four tickets were handled differently.

Should a failed check hold the security patch?

No. The patch still ships. The check shows which response fields changed, so the team can ship the app change that goes with it in the same pull request, or accept the new behavior knowingly.

What does a recording contain?

Whatever the service saw: request and response headers, bodies, tokens and query results. proxymock writes it as files on your machine. Redact real traffic before you commit it, with proxymock record --dlp-config at capture time or proxymock dlp apply afterward.

Does this work for PHP and Ruby services?

proxymock records and replays network traffic, so the check doesn't depend on the service's language. We ran it on a Python and a Java service for this post. We have not run the PHP or Ruby patches through it.

Stop writing API mocks by hand

proxymock records real traffic from your running app and replays it as mocks for HTTP, gRPC, Postgres, Kafka, and more. Install locally, activate once, and start recording.