Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.2.1 instead.
Reason given by maintainers: directory scan fix did not ship; use 0.2.1.

i18n-security-lint

A command-line tool and CI action that scans locale files for security defects introduced through unreviewed translated strings.

It checks the four vulnerability classes documented in the parent repository's Security Scope:

  1. Bidirectional control misuse — overrides (U+202D, U+202E) that make displayed text differ from actual file content, and controls left unterminated so they leak direction into surrounding UI. Balanced isolates (U+2066U+2069) are the mechanism Unicode and W3C recommend and are not reported.
  2. Cross-site scripting (XSS) in rendered locale content — HTML/script fragments embedded in translated strings.
  3. Format-specifier tampering — printf-family specifiers (%s, %d, %1$d, %(name)s) added, removed, or retyped during translation.
  4. Interpolation-variable integrity failures — brace- and template-style variables ({0}, {name}, {{var}}, $t(key)) renamed or omitted, breaking string interpolation.

Full rule ids, severities, and detection methods are specified in spec/translated-string-security-checks.md.

Supported formats

Format Extension Source pair used for checks 3–4
JSON .json translation-only (checks 1–2)
gettext .po msgidmsgstr (all checks)
XLIFF .xliff, .xlf <target> text (checks 1–2)
Fluent .ftl key = value (checks 1–2)

Install

pip install -e .

Usage

# Scan one or more locale files
i18n-security-lint locale/*.po

# Scan a directory recursively, emit JSON, fail CI on any finding
i18n-security-lint --json --strict locale/

Exit code is 1 when --strict is set and at least one finding is reported, so the tool drops straight into a CI pipeline.

GitHub Action

- uses: ecogetaway/oss-language-inclusion/tools/i18n-security-lint@main
  with:
    path: locale/

Status

v0.2. All four check families are implemented and covered by tests. The placeholder checks (3 and 4) need a paired source string, so they run on .po only; JSON, XLIFF, and Fluent are scanned for bidi and XSS. XSS detection is a substring match rather than a parser, and XLIFF markup is stripped during extraction — both limitations are recorded in the spec.

Breaking change in v0.2: rule ids changed. BIDI_OVERRIDE now fires only on true overrides (U+202D/U+202E), with BIDI_UNBALANCED and BIDI_DEPRECATED_EMBEDDING covering the other cases; PLACEHOLDER_DRIFT is replaced by FORMAT_SPECIFIER_DRIFT and INTERPOLATION_DRIFT. Update any CI configuration that filters on rule ids.

License

Apache-2.0 (inherited from the parent repository).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

i18n_security_lint-0.2.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

i18n_security_lint-0.2.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file i18n_security_lint-0.2.0.tar.gz.

File metadata

  • Download URL: i18n_security_lint-0.2.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.5

File hashes

Hashes for i18n_security_lint-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b9240743231bfe55605a3e8c60e6a963d4e58cbccc2618dca1782beff6407524
MD5 18d8578e2eb1f6722ac6e5f80c8db03b
BLAKE2b-256 341a262f7d9f50b4113136730455eed58dd7803b3c510b15fb50bbb7a7d1227e

See more details on using hashes here.

File details

Details for the file i18n_security_lint-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for i18n_security_lint-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc00a978d39e6d88dc32e80965c1d77ea358481abec85f1dc7d9a744f1d35c42
MD5 9c5259bb118c552405d5a6bc76c0bc60
BLAKE2b-256 18fa31ce5ec4a604fc222581a7de9e815bdf7b55ea2f9616c806731cd05eea5e

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.1

2 files

This release

0.2.0 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page