GeoServer has a Server-Side Template Injection (SSTI) vulnerability in processing FreeMarker templates
Description
Summary
A server-side template injection (SSTI) vulnerability exist that allows an authenticated administrator to upload FreeMarker templates containing malicious content that can execute OS commands and read from or write to arbitrary files on the server. These FreeMarker templates are used in a plain GeoServer instance (no extension or community modules) for WMS GetFeatureInfo HTML and JSON and WMS GetMap KML and GeoRSS output formats.
Details
The org.geoserver.template.TemplateUtils.getSafeConfiguration() method attempts to block access to the class freemarker.template.utility.Execute but it is still possible to gain access to it and other sensitive functionality by chaining a specific sequence of method calls.
Impact
This vulnerability can lead to executing arbitrary code and reading and writing arbitrary files.
Resolution
GeoServer 2.27.0 addresses this vulnerability with several new application properties:
- `
GEOSERVER_FREEMARKER_BLOCK_LIST` - `
GEOSERVER_FREEMARKER_ALLOW_LIST` - `
GEOSERVER_FREEMARKER_API_EXPOSED`
These application properties default to restricting the objects template authors can access, and limit access to "getter" methods used to access object properties.
Affected products
4- ghsa-coords3 versions
< 2.27.0+ 2 more
- (no CPE)range: < 2.27.0
- (no CPE)range: < 2.27.0
- (no CPE)range: < 2.27.0
Patches
Vulnerability mechanics
References
6- github.com/advisories/GHSA-wf6j-gr27-g7chghsaADVISORY
- docs.geoserver.org/latest/en/user/tutorials/GetFeatureInfo/html/ghsa
- github.com/geoserver/geoserver/pull/8164ghsa
- github.com/geoserver/geoserver/security/advisories/GHSA-wf6j-gr27-g7chghsa
- osgeo-org.atlassian.net/browse/GEOS-11645ghsa
- osgeo-org.atlassian.net/browse/GEOS-11777ghsa
News mentions
0No linked articles in our index yet.