FileMaker Apache Commons JAR 替换器是一种自动化解决方案,通过替换 FileMaker Server 安装中易受攻击的 Apache Commons JAR 文件来解决 CVE-2025-46295。该方案无需升级整个 FileMaker Server,而是遵循 Claris 官方指南,仅将易受攻击的 commons-text 和 commons-lang3 JAR 文件替换为更新版本。
对于大多数用户,请直接下载最新版本,而无需从源码构建:
前往发布页面
为您的平台下载相应文件:
filemaker-jar-replacer-windows.zipfilemaker-jar-replacer-macos.tar.gzfilemaker-jar-replacer-ubuntu.tar.gz解压并运行 - 有关详细的解压和使用说明,请参阅版本说明
受影响的 JAR 文件仅在首次启用 Web Publishing Engine 时才会安装。
此 JAR 替换器为以下平台提供相应的脚本:
replace-filemaker-jars-windows.ps1)replace-filemaker-jars-macos.sh)replace-filemaker-jars-ubuntu.sh)重要提示:在对 FileMaker Server 进行任何更改之前,请使用 --dry-run 选项运行脚本,以检查您的服务器是否存在漏洞,并查看将要进行的更改。
# Run PowerShell as Administrator
# Show help and available options
.\replace-filemaker-jars-windows.ps1 -Help
# Check if your server is vulnerable (RECOMMENDED FIRST STEP)
.\replace-filemaker-jars-windows.ps1 -DryRun
# Apply the security fix (only after reviewing dry-run results)
.\replace-filemaker-jars-windows.ps1
# Run with sudo privileges
# Show help and available options
sudo ./replace-filemaker-jars-macos.sh --help
# Check if your server is vulnerable (RECOMMENDED FIRST STEP)
sudo ./replace-filemaker-jars-macos.sh --dry-run
# Apply the security fix (only after reviewing dry-run results)
sudo ./replace-filemaker-jars-macos.sh
# Run with sudo privileges
# Show help and available options
sudo ./replace-filemaker-jars-ubuntu.sh --help
# Check if your server is vulnerable (RECOMMENDED FIRST STEP)
sudo ./replace-filemaker-jars-ubuntu.sh --dry-run
# Apply the security fix (only after reviewing dry-run results)
sudo ./replace-filemaker-jars-ubuntu.sh
--dry-run 选项是最安全的方式,可用于:
请务必先使用 --dry-run 运行,以了解脚本将在您的系统上执行哪些操作。
filemaker-jar-replacer/
├── README.md # This file
├── replace-filemaker-jars-windows.ps1 # Windows PowerShell script
├── replace-filemaker-jars-macos.sh # macOS Bash script
├── replace-filemaker-jars-ubuntu.sh # Ubuntu Bash script
├── scripts/
│ ├── windows/
│ │ └── modules/ # PowerShell modules for JAR operations
│ ├── macos/
│ │ └── modules/ # Bash function modules for JAR operations
│ ├── ubuntu/
│ │ └── modules/ # Bash function modules for JAR operations
│ └── shared/ # Shared utilities and templates
├── config/
│ ├── logging-config.json # Logging configuration
│ └── jar-replacement-config.json # JAR replacement configuration
├── tests/ # Test suite (BATS and Pester)
├── logs/ # Log files (created during execution)
└── backups/ # JAR backup files (created during execution)
您可以使用环境变量来配置更新程序:
# FileMaker Server credentials
export FILEMAKER_USERNAME="admin"
export FILEMAKER_PASSWORD="your_secure_password"
# Custom paths (optional)
export FILEMAKER_INSTALL_PATH="/custom/path/to/filemaker"
export BACKUP_DIRECTORY="/custom/backup/path"
在脚本目录中创建一个 .env 文件:
# .env file (must have 600 permissions)
FILEMAKER_USERNAME=admin
FILEMAKER_PASSWORD=your_secure_password
BACKUP_DIRECTORY=/custom/backup/path
重要提示:出于安全考虑,请确保 .env 文件具有严格的权限(600)。
如果自动化脚本失败,请按照以下手动步骤替换易受攻击的 JAR 文件:
# Using fmsadmin (recommended)
& "C:\Program Files\FileMaker\FileMaker Server\Database Server\fmsadmin.exe" stop wpe -u admin -p password
# Or using services
Stop-Service "FileMaker Server Web Publishing Engine"
# Using fmsadmin (recommended)
sudo "/Library/FileMaker Server/Database Server/bin/fmsadmin" stop wpe -u admin -p password
# Or using launchctl
sudo launchctl stop com.filemaker.wpe
# Using fmsadmin (recommended)
sudo "/opt/FileMaker/FileMaker Server/Database Server/bin/fmsadmin" stop wpe -u admin -p password
# Or using systemctl
sudo systemctl stop filemaker-wpe
$jarPath = "C:\Program Files\FileMaker\FileMaker Server\Web Publishing\publishing-engine\jwpc-tomcat\webapps\ROOT\WEB-INF\lib"
$backupPath = "C:\Temp\jar-backup-$(Get-Date -Format 'yyyyMMdd-HHmmss')"
New-Item -ItemType Directory -Path $backupPath
Copy-Item "$jarPath\commons-text-*.jar" $backupPath
Copy-Item "$jarPath\commons-lang3-*.jar" $backupPath
JAR_PATH="/Library/FileMaker Server/Web Publishing/publishing-engine/jwpc-tomcat/webapps/ROOT/WEB-INF/lib" # macOS
# JAR_PATH="/opt/FileMaker/FileMaker Server/Web Publishing/publishing-engine/jwpc-tomcat/webapps/ROOT/WEB-INF/lib" # Ubuntu
BACKUP_PATH="/tmp/jar-backup-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$BACKUP_PATH"
cp "$JAR_PATH"/commons-text-*.jar "$BACKUP_PATH/"
cp "$JAR_PATH"/commons-lang3-*.jar "$BACKUP_PATH/"
从 Apache Commons 下载以下 JAR 文件:
请将校验和与 Apache Commons 官方校验和进行比对验证。
$jarPath = "C:\Program Files\FileMaker\FileMaker Server\Web Publishing\publishing-engine\jwpc-tomcat\webapps\ROOT\WEB-INF\lib"
# Remove old JAR files
Remove-Item "$jarPath\commons-text-*.jar"
Remove-Item "$jarPath\commons-lang3-*.jar"
# Copy new JAR files
Copy-Item "commons-text-1.11.0.jar" $jarPath
Copy-Item "commons-lang3-3.18.0.jar" $jarPath
JAR_PATH="/Library/FileMaker Server/Web Publishing/publishing-engine/jwpc-tomcat/webapps/ROOT/WEB-INF/lib" # macOS
# JAR_PATH="/opt/FileMaker/FileMaker Server/Web Publishing/publishing-engine/jwpc-tomcat/webapps/ROOT/WEB-INF/lib" # Ubuntu
# Remove old JAR files
sudo rm "$JAR_PATH"/commons-text-*.jar
sudo rm "$JAR_PATH"/commons-lang3-*.jar
# Copy new JAR files
sudo cp commons-text-1.11.0.jar "$JAR_PATH/"
sudo cp commons-lang3-3.18.0.jar "$JAR_PATH/"
# Set proper permissions
sudo chown fmserver:fmsadmin "$JAR_PATH"/commons-*.jar # Adjust ownership as needed
sudo chmod 644 "$JAR_PATH"/commons-*.jar
# Using fmsadmin (recommended)
& "C:\Program Files\FileMaker\FileMaker Server\Database Server\fmsadmin.exe" start wpe -u admin -p password
# Or using services
Start-Service "FileMaker Server Web Publishing Engine"
# Using fmsadmin (recommended)
sudo "/Library/FileMaker Server/Database Server/bin/fmsadmin" start wpe -u admin -p password
# Or using launchctl
sudo launchctl start com.filemaker.wpe
# Using fmsadmin (recommended)
sudo "/opt/FileMaker/FileMaker Server/Database Server/bin/fmsadmin" start wpe -u admin -p password
# Or using systemctl
sudo systemctl start filemaker-wpe
如果自动化脚本失败,请按照以下手动步骤操作:
net stop "FileMaker Server"
sudo launchctl stop com.filemaker.fms
sudo service fmshelper stop
net start "FileMaker Server"
sudo launchctl start com.filemaker.fms
sudo service fmshelper start
logs\filemaker-jar-replacer-windows.loglogs/filemaker-jar-replacer-macos.loglogs/filemaker-jar-replacer-ubuntu.log该项目包含适用于所有平台的全面测试套件,以确保可靠性和安全性。
该项目为每个平台使用不同的测试框架:
macOS(使用 Homebrew):
brew install bats-core
Ubuntu/Debian:
# Install via package manager
sudo apt update
sudo apt install bats
# Or install latest version from source
git clone https://github.com/bats-core/bats-core.git
cd bats-core
sudo ./install.sh /usr/local
手动安装(任何类 Unix 系统):
git clone https://github.com/bats-core/bats-core.git
cd bats-core
sudo ./install.sh /usr/local
Pester 随 PowerShell 5.1+ 和 Windows PowerShell 预装,但您可能需要将其更新到最新版本:
# Check current version
Get-Module -Name Pester -ListAvailable
# Install/Update to latest version (PowerShell 5.1+)
Install-Module -Name Pester -Force -SkipPublisherCheck
# For PowerShell Core (7+)
Install-Module -Name Pester -Scope CurrentUser
# Run specific BATS test file (Linux/macOS)
bats tests/backup-creation.bats
bats tests/version-detection.bats
# Run specific Pester test file (Windows)
Invoke-Pester tests/windows/Integration.Tests.ps1
Invoke-Pester tests/windows/Utilities.Tests.ps1
# Run all BATS tests (Linux/macOS)
bats tests/*.bats
# Run all Pester tests (Windows)
Invoke-Pester tests/windows/
测试套件包括:
测试会创建隔离的临时环境,不会影响您的系统或 FileMaker 安装。不过,某些测试可能需要:
此 JAR 替换器按原样提供,用于解决 CVE-2025-46295。使用时请遵守您的 FileMaker Server 许可协议和 Apache Commons 许可条款。