Exploit databaseDownload repository ZIP
GH-b3b5d62ebd8de67f10fb19efbcb1a879
frnmrls/php70-cve-2026-backport
Sources for CVE-2026-109618
412 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files15
frnmrls/php70-cve-2026-backportRevision c685e83a5dec
- .github/
- patches/
- scripts/
- tests/
- verification/
- .dockerignore
- .gitignore
- CHANGELOG.md
- LICENSE
- QUICKSTART.md
- README.md
- SECURITY.md
- install.sh
- rollback.sh
- verify.sh
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
verify.sh
Suggested starting fileShell · 3,372 bytes#!/usr/bin/env bash
#
# Runtime verifier for the PHP 7.0.33 CVE-2026-109618/109619 backport.
#
# Usage:
# ./verify.sh --prefix /opt/php70-cve
# ./verify.sh --prefix /opt/php70-cve --service https://host/security-probe.php
# ./verify.sh --php /path/to/php [--json]
#
# Local mode checks runtime markers and, when --prefix is used, binds the real
# binary SHA-256 to the installer manifest. Service mode additionally checks
# the runtime answering scripts/service-probe.php and the loaded binary/module.
#
# Exit codes: 0 = verified, 1 = failed/mismatch, 2 = usage/environment error.
#
set -euo pipefail
ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
PREFIX=""
PHP_BIN="${PHP_BIN:-}"
SERVICE_URL=""
MODULE=""
EXPECT_SAPI=""
REPO="$ROOT"
JSON=0
die() { echo "ERROR: $*" >&2; exit 2; }
usage() {
cat <<EOF
Usage: ./verify.sh [options]
--prefix DIR Installed prefix (recommended): reads its manifest and
verifies bin/php against the recorded SHA-256.
--php PATH PHP binary for an advanced/unmanaged check.
--service URL Also verify the service answering scripts/service-probe.php.
--module PATH Expected libphp7.so (defaults to PREFIX/lib/libphp7.so).
--expect-sapi SAPI Require a specific service SAPI (e.g. fpm-fcgi).
--json Emit machine-readable JSON only.
--repo DIR Repository root for the patch (default: script dir).
-h, --help Show this help.
EOF
}
while [ $# -gt 0 ]; do
case "$1" in
--prefix) [ $# -ge 2 ] || die "--prefix needs a value"; PREFIX="$2"; shift 2 ;;
--php) [ $# -ge 2 ] || die "--php needs a value"; PHP_BIN="$2"; shift 2 ;;
--service) [ $# -ge 2 ] || die "--service needs a value"; SERVICE_URL="$2"; shift 2 ;;
--module) [ $# -ge 2 ] || die "--module needs a value"; MODULE="$2"; shift 2 ;;
--expect-sapi) [ $# -ge 2 ] || die "--expect-sapi needs a value"; EXPECT_SAPI="$2"; shift 2 ;;
--json) JSON=1; shift ;;
--repo) [ $# -ge 2 ] || die "--repo needs a value"; REPO="$2"; shift 2 ;;
-h|--help) usage; exit 0 ;;
*) die "unknown argument: $1 (use --help)" ;;
esac
done
if [ -n "$PREFIX" ]; then
[ -d "$PREFIX" ] || die "prefix not found: $PREFIX"
[ -n "$PHP_BIN" ] || PHP_BIN="$PREFIX/bin/php"
[ -n "$MODULE" ] && [ -z "$SERVICE_URL" ] && die "--module requires --service"
if [ -z "$MODULE" ] && [ -f "$PREFIX/lib/libphp7.so" ]; then
MODULE="$PREFIX/lib/libphp7.so"
fi
fi
if [ -z "$PHP_BIN" ]; then
PHP_BIN=$(command -v php 2>/dev/null || true)
fi
[ -n "$PHP_BIN" ] || die "use --prefix DIR or --php PATH"
[ -x "$PHP_BIN" ] || die "PHP binary is not executable: $PHP_BIN"
REPO=$(cd "$REPO" && pwd) || die "repository directory not found"
PHP_SCRIPT="$REPO/scripts/verify.php"
[ -f "$PHP_SCRIPT" ] || die "verifier script not found: $PHP_SCRIPT"
if [ -n "$SERVICE_URL" ] && [ -z "$PREFIX" ] && [ -z "$MODULE" ]; then
die "service verification requires --prefix DIR or --module PATH to bind the remote runtime"
fi
ARGS=("$REPO")
[ "$JSON" -eq 1 ] && ARGS+=("--json")
[ -n "$PREFIX" ] && ARGS+=("--prefix" "$PREFIX")
[ -n "$SERVICE_URL" ] && ARGS+=("--service-url" "$SERVICE_URL")
[ -n "$MODULE" ] && ARGS+=("--module" "$MODULE")
[ -n "$EXPECT_SAPI" ] && ARGS+=("--expect-sapi" "$EXPECT_SAPI")
exec "$PHP_BIN" "$PHP_SCRIPT" "${ARGS[@]}"