Exploit database

GH-5ce8023524718e1464ef96a65bc3d464

dinosn/cve-2026-103849-blockstrap-lab

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-103849

1 source

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.

Repository files9
dinosn/cve-2026-103849-blockstrap-labRevision e9ce56baa725

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

scripts/run-http-ab.sh

Shell · 3,475 bytes
#!/usr/bin/env bash
set -euo pipefail

vulnerable_output="$(mktemp)"
patched_output="$(mktemp)"

restore_patched() {
  local exit_status=$?
  local cleanup_status=0
  trap - EXIT INT TERM
  set +e
  docker compose exec -T php bash /lab/scripts/set-state.sh patched \
    >/dev/null 2>&1 || cleanup_status=1
  docker compose exec -T php bash -lc \
    'cd /var/www/html && git apply --reverse --check /lab/patches/APSB26-153_BlockStrap_249-monorepo.patch >/dev/null' \
    || cleanup_status=1
  rm -f -- "$vulnerable_output" "$patched_output"
  if [[ "$cleanup_status" -eq 0 ]]; then
    printf '[HTTP A/B] cleanup verified: source is patched\n'
  else
    printf '[HTTP A/B] cleanup verification failed; inspect the lab state.\n' >&2
    if [[ "$exit_status" -eq 0 ]]; then
      exit_status=1
    fi
  fi
  exit "$exit_status"
}
trap restore_patched EXIT
trap 'exit 130' INT
trap 'exit 143' TERM

binding_url() {
  local service="$1"
  local port="$2"
  local binding
  binding="$(docker compose port "$service" "$port")"
  case "$binding" in
    127.0.0.1:*) printf 'http://%s\n' "$binding" ;;
    *)
      printf 'Refusing non-loopback %s binding: %s\n' "$service" "$binding" >&2
      exit 64
      ;;
  esac
}

magento_target="$(binding_url nginx 80)"
mailbox_target="$(binding_url mailhog 8025)"

printf '\n[HTTP A/B] Selecting the VULN-39341-only state\n'
docker compose exec -T php bash /lab/scripts/set-state.sh vulnerable
set +e
python3 poc/http_primitive_probe.py \
  --target "$magento_target" \
  --mailbox "$mailbox_target" \
  --expect vulnerable >"$vulnerable_output" 2>&1
vulnerable_status=$?
set -e
cat "$vulnerable_output"

printf '\n[HTTP A/B] Applying the APSB26-153 BlockStrap engine fix\n'
docker compose exec -T php bash /lab/scripts/set-state.sh patched
set +e
python3 poc/http_primitive_probe.py \
  --target "$magento_target" \
  --mailbox "$mailbox_target" \
  --expect patched >"$patched_output" 2>&1
patched_status=$?
set -e
cat "$patched_output"

vulnerable_match=false
vulnerable_mail=false
vulnerable_marker=false
patched_match=false
patched_mail=false
patched_marker=true
grep -q '"expectation_met": true' "$vulnerable_output" && vulnerable_match=true
grep -q '"mail_captured": true' "$vulnerable_output" && vulnerable_mail=true
grep -q '"transformed_marker_observed": true' "$vulnerable_output" && vulnerable_marker=true
grep -q '"expectation_met": true' "$patched_output" && patched_match=true
grep -q '"mail_captured": true' "$patched_output" && patched_mail=true
grep -q '"transformed_marker_observed": true' "$patched_output" || patched_marker=false

printf '\n[HTTP A/B] Summary\n'
printf '  VULN-39341 only: exit=%s, mail=%s, transformed-marker=%s, matched=%s\n' \
  "$vulnerable_status" "$vulnerable_mail" "$vulnerable_marker" "$vulnerable_match"
printf '  October fixed:   exit=%s, mail=%s, transformed-marker=%s, matched=%s\n' \
  "$patched_status" "$patched_mail" "$patched_marker" "$patched_match"
printf '  Final source state: patched\n'

if [[ "$vulnerable_status" -eq 0 \
   && "$vulnerable_mail" == true \
   && "$vulnerable_marker" == true \
   && "$vulnerable_match" == true \
   && "$patched_status" -eq 0 \
   && "$patched_mail" == true \
   && "$patched_marker" == false \
   && "$patched_match" == true ]]; then
  printf '[PASS] The unauthenticated HTTP/email BlockStrap primitive matches both A/B controls.\n'
  exit 0
fi

printf '[FAIL] The HTTP/email observation did not match the required A/B oracle.\n' >&2
exit 1