PyPI / babel / 2.19.0

babel 2.19.0

Source
https://github.com/python-babel/babel
Artifact scanned
babel-2.19.0-py3-none-any.whl (wheel · 10.5 MB · SHA-256 6d49734aed1d…)
Compared with
babel-2.18.0-py3-none-any.whl (1 signals introduced since)
Files
28 scanned, 1155 skipped (binary, oversized, or unrecognised)
Signals
0 critical · 0 warn · 6 info
Scan time
6.2 s
LLM review
Reviewed by claude-haiku-5-5 (Anthropic): 3 of 3 warn and critical signals; 3 demoted to info.
Disclude version
4.3.0
Scanned (UTC)
2026-11-24 20:43

Signals

Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.

  1. info unicode-mixed-script babel/messages/plurals.py:248:7 new in this release

    identifier `Metaʼ` mixes scripts: Latin + Other (in string/comment) (raw pass, confidence 0.40)

        'mg': (2, '(n > 1)'),
        # Metaʼ
        'mgo': (2, '(n != 1)'),
        # Macedonian
  2. info critical → info by review dynamic-import babel/messages/extract.py:496:24

    `__import__` called on a non-literal expression (ast pass, confidence 0.70)

                module, attrname = method.split(':', 1)
            func = getattr(__import__(module, {}, {}, [attrname]), attrname)
        else:
            func = _find_extractor(method)
    likely benign LLM, confidence 0.85 Babel imports a configured extractor module by name to call its extraction function.
    Reasoning

    The snippet splits a configured 'module:attr' method spec and imports the module with __import__, then fetches the attribute. This is the standard plugin/extractor loading path in Babel, where the method name comes from the extraction configuration the developer supplies. It is a dynamic import, but it is not a hidden or fetched-remotely payload, so it reads as a legitimate extension mechanism.

  3. info unicode-mixed-script babel/numbers.py:631:14

    identifier `xa0ألف` mixes scripts: Latin + Arabic (in string/comment) (raw pass, confidence 0.40)

        >>> format_compact_decimal(12345, format_type="short", locale='ar_EG', fraction_digits=2, numbering_system='default')
        '12٫34\\xa0ألف'
    
        :param number: the number to format
  4. info unicode-mixed-script babel/numbers.py:736:25

    identifier `xa0ج` mixes scripts: Latin + Arabic (in string/comment) (raw pass, confidence 0.40)

        >>> format_currency(1099.98, 'EGP', locale='ar_EG', numbering_system='default')
        '\\u200f1٬099٫98\\xa0ج.م.\\u200f'
    
        The format can also be specified explicitly.  The currency is
  5. info warn → info by review dynamic-execution babel/plural.py:240:12

    `compile` called on a non-literal expression (ast pass, confidence 0.70)

        result.append(f" return {_fallback_tag!r}")
        code = compile('\n'.join(result), '<rule>', 'exec')
        eval(code, namespace)
        return namespace['evaluate']
    likely benign LLM, confidence 0.80 Babel compiles generated Python source for plural rules and executes it into a namespace.
    Reasoning

    The code builds Python source from parsed plural-rule expressions (CLDR-style rules) and compiles it into a namespace. The rules come from locale data or developer-supplied rule strings, not from network input or an encoded blob. Generating and evaluating a small evaluator function is an intentional design for speed, so this looks like a legitimate code-generation pattern. The residual doubt is that eval is reached with generated code, so injection would be possible if untrusted rule strings were accepted.

  6. info warn → info by review dynamic-execution babel/plural.py:241:5

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

        code = compile('\n'.join(result), '<rule>', 'exec')
        eval(code, namespace)
        return namespace['evaluate']
    likely benign LLM, confidence 0.80 Babel evaluates the compiled plural-rule code to produce an evaluate function.
    Reasoning

    This eval runs the code object produced by the compile call just above, inside a controlled namespace, and returns the 'evaluate' function. It is the second half of the same plural-rule code generation. Nothing in the snippet shows attacker-controlled input or an unusual payload, so it reads as benign, with the same caveat about untrusted rule strings.

Reproduce This Scan

Run disclude locally to verify. These commands scan the published file; the "new in this release" marks come from comparing it with the previous release's file, which they don't repeat. Add --format sarif for SARIF output. Add --llm (with an API key in the environment) to include the LLM review.

cargo install disclude --version 4.3.0
curl -fsSL -o babel-2.19.0-py3-none-any.whl https://files.pythonhosted.org/packages/71/3b/ddf4b07be846bfa361683729b5948c9c61a87fbdf09e69540d8e586bb7c5/babel-2.19.0-py3-none-any.whl
printf '%s  %s\n' 6d49734aed1d595b2c065d012174df8c83964692f26fc461702281634dd7555b babel-2.19.0-py3-none-any.whl | shasum -a 256 -c -
unzip -q babel-2.19.0-py3-none-any.whl -d pkg
disclude scan --untrusted --severity info pkg