CVE-2024-45747 json
GeoServer has a Server-Side Template Injection (SSTI) vulnerability in processing FreeMarker templates
published 2mo ago modified 2mo ago also GHSA-wf6j-gr27-g7ch
- cvss
- 7.2
- version 3.1, GitHub
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- —
- no EPSS score yet
- public exploits
- 0
- none known
Summary
### 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.
Patch / fix
- maven org.geoserver:gs-main 2.27.0
- maven org.geoserver:gs-wms 2.27.0
- maven org.geoserver.web:gs-web-app 2.27.0
- github.com/geoserver/geoserver#8164 pull request
Is CVE-2024-45747 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerCVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| GitHub | 3.1 | 7.2 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| maven | org.geoserver:gs-main | <2.27.0 |
2.27.0 |
| maven | org.geoserver:gs-wms | <2.27.0 |
2.27.0 |
| maven | org.geoserver.web:gs-web-app | <2.27.0 |
2.27.0 |
Classification
- Weakness
-
- CWE-749 Exposed Dangerous Method or Function
References
-
github.com
/geoserver/geoserver/pull/8164
web
-
github.com
/geoserver/geoserver/security/advisories/GHSA-wf6j-gr27-g7ch
web
-
docs.geoserver.org
/latest/en/user/tutorials/GetFeatureInfo/html/#accessing-instance-methods
web
-
github.com
/geoserver/geoserver
package
-
osgeo-org.atlassian.net
/browse/GEOS-11645
web
-
osgeo-org.atlassian.net
/browse/GEOS-11777
web
Sources
- GitHub Advisory GHSA-wf6j-gr27-g7ch
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.