Intel

AIKIDO-2026-10056

publish-flat is vulnerable to Improper Input Validation

Improper Input Validation Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.

26

Low Risk

This Affects:

JSpublish-flat
1.0.0 - 1.17.0
Fixed in 1.17.1

TL;DR

Affected versions of the package are vulnerable to regular expression injection due to the use of a user-controlled directory value when dynamically constructing a RegExp without proper escaping. By embedding the raw dirToFlatten value directly into a regular expression, an attacker can inject arbitrary regex fragments and influence matching behavior. Properly escaping all regex metacharacters before building dirToFlattenRegex preserves the intended semantics while preventing regex injection.

Who does this affect?

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

Background info

publish-flat is vulnerable to Improper Input Validation in versions 1.0.0 - 1.17.0.

How to fix this

Upgrade the publish-flat library to the patch version.