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+2066–U+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 msgid → msgstr (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).

Metadata

Release files for i18n-security-lint 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for i18n-security-lint 0.2.1
File Size Uploaded Provenance Actions
i18n_security_lint-0.2.1.tar.gz 11.1 kB Without provenance Details for i18n_security_lint-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for i18n-security-lint 0.2.1
File Interpreter ABI Platform Actions
i18n_security_lint-0.2.1-py3-none-any.whl Python 3 none any Details for i18n_security_lint-0.2.1-py3-none-any.whl

Total release size: 20.0 kB

Release files / i18n_security_lint-0.2.1.tar.gz

Download URL i18n_security_lint-0.2.1.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
db79ca1480bfdb68ef175a94e93dc8edf1b2c723d77a82a53b6e47d95f02fa55
BLAKE2b-256 checksum
How to use checksums
e3ddb18a314f8a307893a64c6d1d564f3d8dbc9e32c133bd155f34b1ca23e973
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.5

Release files / i18n_security_lint-0.2.1-py3-none-any.whl

Download URL i18n_security_lint-0.2.1-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d28fa763636d3df294d9658b91d5abbac550573ec875fb64c5f813f0161d5c4
BLAKE2b-256 checksum
How to use checksums
75cf28693420e234497bba3d0dde3949c7efd4d90b82de2c0954391a34f50aac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.5

Security for i18n-security-lint 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files No provenance

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