Security Advisory

CVE-2023-39631: TiTiler Remote Code Execution via numexpr Expression Evaluation

Remote code execution through unsafe expression evaluation in numexpr, exploited by XBOW through TiTiler's expression parser.

Overview

numexpr is a Python library for fast numerical expression evaluation. Before 2.8.5 its evaluate function passed expressions to eval() with no filtering. TiTiler, a dynamic tile server for geospatial data, exposes an expression parameter that feeds numexpr.

An unauthenticated attacker sends a crafted expression to a TiTiler endpoint and runs arbitrary Python on the server. The same flaw was reported against LangChain's math chain, and the CVE record names LangChain 0.0.245. numexpr 2.8.5 adds input validation that blocks the dangerous characters; LangChain 0.0.308 picks up the fix.

Affected products

  • numexpr before 2.8.5
  • TiTiler deployments running an unpatched numexpr
  • LangChain 0.0.245 through 0.0.307

Disclosure timeline

06 Aug 2023
pydata releases numexpr 2.8.5 with input validation on evaluate()
01 Sep 2023
CVE-2023-39631 published
2023
LangChain 0.0.308 updates the numexpr dependency

XBOW blog: TiTiler RCE