CVE-2026-59376
Patch Available.
This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.
Overview
Spring HATEOAS is a library in the Spring portfolio that helps developers build REST APIs which follow the HATEOAS principle, providing link and representation models and support for hypermedia formats such as HAL, HAL-FORMS, Collection+JSON and UBER.
An authorization bypass vulnerability (CVE-2026-59376) has been identified in Spring HATEOAS's Collection+JSON and UBER request deserialization, which allows attackers to set properties that the application declared read-only with @JsonProperty(access = Access.READ_ONLY). A client that can submit a Collection+JSON or UBER request body can populate server-owned properties, such as a role, permission or account-state property, that the application expects to be ignored on input.
Per OWASP: Software frameworks sometimes allow developers to automatically bind HTTP request parameters into program code variables or objects to make using that framework easier on developers. This can sometimes cause harm. Attackers can sometimes use this methodology to create new parameters that the developer never intended which in turn creates or overwrites new variable or objects in program code that was not intended. This is called a Mass Assignment vulnerability.
This issue affects multiple versions of Spring HATEOAS.
Details
Module Info
- Product: Spring HATEOAS
- Affected packages:
org.springframework.hateoas:spring-hateoas - Affected versions: <=1.5.8, >=2.0.0 <=2.4.3, >=2.5.0 <=2.5.4, >=3.0.0 <=3.0.6, >=3.1.0 <=3.1.3
- GitHub repository: https://github.com/spring-projects/spring-hateoas
- Published packages: https://central.sonatype.com/artifact/org.springframework.hateoas/spring-hateoas
- Package manager: Maven
- Fixed in:
- OSS Spring HATEOAS 3.0.7, 3.1.4
- NES for Spring HATEOAS
Vulnerability Info
This Medium-severity vulnerability is found in the org.springframework.hateoas:spring-hateoas package in multiple versions of Spring HATEOAS. Its CVSS 3.1 base score is 6.5 (AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N).
The Collection+JSON (application/vnd.collection+json) and UBER (application/vnd.uber+json) media types do not deserialize request bodies with Jackson's bean deserializer. Instead, Jackson2CollectionJsonModule, CollectionJsonItem and Jackson2UberModule collect the name/value pairs of the incoming representation and pass them to PropertyUtils.createObjectFromProperties, a reflection-based binder that instantiates the target type and invokes each property's setter directly:
public static <T> T createObjectFromProperties(BeanDescription description, Map<String, Object> properties) {
Class<?> clazz = description.getBeanClass();
T obj = (T) BeanUtils.instantiateClass(clazz);
Map<String, PropertyDescriptor> descriptors = getPropertyDescriptorMap(clazz);
description.findProperties().forEach(it -> {
PropertyDescriptor descriptor = descriptors.get(it.getInternalName());
if (descriptor != null) {
Method writeMethod = descriptor.getWriteMethod();
if (writeMethod == null) {
return;
}
ReflectionUtils.makeAccessible(writeMethod);
try {
writeMethod.invoke(obj, properties.get(it.getName()));
} catch (IllegalAccessException | InvocationTargetException e) {
throw new RuntimeException(e);
}
}
});
return obj;
}
The set of writable properties comes from getPropertyDescriptorMap, which only removes properties excluded through @JsonIgnore and @JsonIgnoreProperties:
private static Map<String, PropertyDescriptor> getPropertyDescriptorMap(Class<?> type) {
return Arrays.stream(BeanUtils.getPropertyDescriptors(type))
.filter(descriptor -> !FIELDS_TO_IGNORE.contains(descriptor.getName()))
.filter(descriptor -> !descriptorToBeIgnoredByJackson(type, descriptor))
.filter(descriptor -> !toBeIgnoredByJackson(type, descriptor.getName()))
.filter(descriptor -> !readerIsToBeIgnoredByJackson(descriptor))
.collect(Collectors.toMap(PropertyDescriptor::getName, Function.identity()));
}
On older lines, createObjectFromProperties(Class<T>, Map<String, Object>) resolves each incoming key with BeanUtils.getPropertyDescriptor(clazz, key) and calls its setter without any Jackson-based filtering at all. In both forms, nothing checks whether the property is declared @JsonProperty(access = Access.READ_ONLY) on its field, getter or setter. A client-supplied value for such a property is therefore written to the bound object, even though the same payload sent as application/json is handled by Jackson's bean deserializer, which ignores it. Applications are exposed when they enable Collection+JSON or UBER hypermedia support and bind request bodies directly onto a domain type that declares a read-only property with a setter. Applications that use only HAL or HAL-FORMS, or that bind requests onto dedicated input DTOs without read-only properties, do not reach this binder with such a type.
Mitigation
Only recent versions of Spring HATEOAS receive community support. Older lines are End-of-Life and will not receive public updates to address this issue.
Users of the affected components should apply one of the following mitigations:
- Upgrade to a currently supported version of Spring HATEOAS.
- Leverage a commercial support partner like HeroDevs for post-EOL security support.
Credits
Yu Bao from PayPal Cyber Security Team (finder)