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