ghsa-7g5f-wrx8-5ccf
Vulnerability from github
Published
2023-02-22 19:15
Modified
2023-02-22 19:15
Severity ?
Summary
GeoServer OGC Filter SQL Injection Vulnerabilities
Details

Impact

GeoServer includes support for the OGC Filter expression language and the OGC Common Query Language (CQL) as part of the Web Feature Service (WFS) and Web Map Service (WMS) protocols. CQL is also supported through the Web Coverage Service (WCS) protocol for ImageMosaic coverages.

SQL Injection Vulnerabilities have been found with:

  • PropertyIsLike filter, when used with a String field and any database DataStore, or with a PostGIS DataStore with encode functions enabled
  • strEndsWith function, when used with a PostGIS DataStore with encode functions enabled
  • strStartsWith function, when used with a PostGIS DataStore with encode functions enabled
  • FeatureId filter, when used with any database table having a String primary key column and when prepared statements are disabled
  • jsonArrayContains function, when used with a String or JSON field and with a PostGIS or Oracle DataStore (GeoServer 2.22.0+ only)
  • DWithin filter, when used with an Oracle DataStore

Patches

  • GeoSever 2.21.4
  • GeoServer 2.22.2
  • GeoServer 2.20.7
  • GeoServer 2.19.7
  • GeoServer 2.18.7

Workarounds

  1. Disabling the PostGIS Datastore encode functions setting to mitigate strEndsWith, strStartsWith vulnerabilities (Like filters have no mitigation, if there is a string field in the feature type published).
  2. Enabling the PostGIS DataStore preparedStatements setting to mitigate the FeatureId vulnerability.

References

Show details on source website


{
  "affected": [
    {
      "package": {
        "ecosystem": "Maven",
        "name": "org.geoserver.community:gs-jdbcconfig"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "2.21.4"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Maven",
        "name": "org.geoserver.community:gs-jdbcconfig"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "2.22.0"
            },
            {
              "fixed": "2.22.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2023-25157"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-89"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2023-02-22T19:15:56Z",
    "nvd_published_at": "2023-02-21T22:15:00Z",
    "severity": "CRITICAL"
  },
  "details": "### Impact\n\nGeoServer includes support for the OGC Filter expression language and the OGC Common Query Language (CQL) as part of the Web Feature Service (WFS) and Web Map Service (WMS) protocols.  CQL is also supported through the Web Coverage Service (WCS) protocol for ImageMosaic coverages.\n\nSQL Injection Vulnerabilities have been found with:\n\n* ``PropertyIsLike`` filter, when used with a String field and any database DataStore, or with a PostGIS DataStore with encode functions enabled\n* ``strEndsWith`` function, when used with a PostGIS DataStore with encode functions enabled\n* ``strStartsWith`` function, when used with a PostGIS DataStore with encode functions enabled\n* ``FeatureId`` filter, when used with any database table having a String primary key column and when prepared statements are disabled\n* ``jsonArrayContains`` function, when used with a String or JSON field and with a PostGIS or Oracle DataStore (GeoServer 2.22.0+ only)\n* ``DWithin`` filter, when used with an Oracle DataStore\n\n### Patches\n\n* GeoSever 2.21.4\n* GeoServer 2.22.2\n* GeoServer 2.20.7\n* GeoServer 2.19.7\n* GeoServer 2.18.7\n\n### Workarounds\n\n1. Disabling the PostGIS Datastore *encode functions* setting to mitigate ``strEndsWith``, ``strStartsWith`` vulnerabilities (Like filters have no mitigation, if there is a string field in the feature type published).\n2. Enabling the PostGIS DataStore *preparedStatements* setting to mitigate the ``FeatureId`` vulnerability.\n\n### References\n\n* [OGC Filter SQL Injection Vulnerabilities](https://github.com/geotools/geotools/security/advisories/GHSA-99c3-qc2q-p94m) (GeoTools)\n* [OGC Filter Injection Vulnerability Statement](https://geoserver.org/vulnerability/2023/02/20/ogc-filter-injection.html) (GeoServer Blog)",
  "id": "GHSA-7g5f-wrx8-5ccf",
  "modified": "2023-02-22T19:15:56Z",
  "published": "2023-02-22T19:15:56Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/geoserver/geoserver/security/advisories/GHSA-7g5f-wrx8-5ccf"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2023-25157"
    },
    {
      "type": "WEB",
      "url": "https://github.com/geoserver/geoserver/commit/145a8af798590288d270b240235e89c8f0b62e1d"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/geoserver/geoserver"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "GeoServer OGC Filter SQL Injection Vulnerabilities"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading...

Loading...

Loading...

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.