Skip to main content

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 i18n-security-lint

Or, for development, from this directory:

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 checks are implemented: bidi and XSS for every supported format, format-specifier and interpolation-variable drift for .po source/translation pairs. The test suite covers each check across JSON, gettext, XLIFF, and Fluent corpus files, and the repository's CI dogfoods the scanner against the malicious corpus on every push (it must flag every malicious file and pass the clean one). This is the flagship security deliverable of the Open Source Language Inclusion initiative, demonstrated as required.

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. Migration table in the spec.

Known limitations: detection is pattern-based, not parser-accurate — see the repository's SECURITY.md for scope and how to report bypasses.

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.1.tar.gz (11.1 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.1-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: i18n_security_lint-0.2.1.tar.gz
  • Upload date:
  • Size: 11.1 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.1.tar.gz
Algorithm Hash digest
SHA256 db79ca1480bfdb68ef175a94e93dc8edf1b2c723d77a82a53b6e47d95f02fa55
MD5 c164b2e0a53d04b6b00a0dd659435846
BLAKE2b-256 e3ddb18a314f8a307893a64c6d1d564f3d8dbc9e32c133bd155f34b1ca23e973

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for i18n_security_lint-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6d28fa763636d3df294d9658b91d5abbac550573ec875fb64c5f813f0161d5c4
MD5 3177862fc8537d1eda59a95731333759
BLAKE2b-256 75cf28693420e234497bba3d0dde3949c7efd4d90b82de2c0954391a34f50aac

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 files

0.2.0

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