Overview
About vulnerability
ResourceCacheService.getCacheName() builds the on-disk filename by appending the URI fragment verbatim, without stripping path separators or .. sequences, and passes the result to new File(resourceParentFolder, newFileName) before writing the downloaded bytes there.
An application that passes model or tokenizer URIs from a less-trusted source (tenant configuration, admin UI, external catalogue) to TransformersEmbeddingModel.setModelResource() or setTokenizerResource() can be exploited by supplying a URI with a crafted fragment (e.g. #/../../../../opt/app/conf/override.properties) to write attacker-controlled content to an arbitrary path outside the cache directory.
Details
- Affected product:
- Spring
- Affected packages:
- spring-ai-starter-model-stability-ai @ 1.1.8 (+327 more)