Intel

AIKIDO-2026-10445

pythainlp is vulnerable to Path Traversal

Path Traversal Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Apr 1, 2026

59

Medium Risk

This Affects:

PYTHONpythainlp
2.1 - 5.3.1
Fixed in 5.3.2
Are you affected? Scan for Free

TL;DR

Data and corpus path helpers in PyThaiNLP joined user-supplied path segments with the intended base directory using plain os.path.join without verifying the resolved path stayed inside that directory. Values containing .. segments could normalize to locations outside the PyThaiNLP data or corpus roots, so downstream file operations could touch unintended paths when callers passed untrusted or externally influenced strings. The fix centralizes containment in safe_path_join, which normalizes paths and rejects resolutions outside the base directory, and removes redundant helper paths that widened the attack surface.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range.

Background info

pythainlp is vulnerable to Path Traversal in versions 2.1 - 5.3.1.

How to fix this

Upgrade the pythainlp library to the patch version.