Skip to main content

Python port of RetireJS - A tool to scan for vulnerabilities in JavaScript libraries

Project description

UnretiredJS

A Python port of RetireJS - A tool to scan for vulnerabilities in JavaScript libraries.

PyPI PyPI License

Description

UnretiredJS is a Python library that helps you identify known vulnerabilities in JavaScript libraries used in your web applications. It's a port of the popular RetireJS tool, bringing the same powerful vulnerability scanning capabilities to Python projects.

Note: This is a fork of FallibleInc/retirejslib, maintained and updated with additional features and improvements.

Installation

pip install unretiredjs

Usage

Basic Usage

import unretiredjs

# Scan a remote JavaScript file
results = unretiredjs.scan_endpoint("http://code.jquery.com/jquery-1.6.min.js")

Sample Output

[
    {
        'detection': 'filecontent',
        'vulnerabilities': [
            {
                'info': [
                    'http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-4969',
                    'http://research.insecurelabs.org/jquery/test/'
                ],
                'identifiers': {
                    'CVE': ['CVE-2011-4969']
                },
                'severity': 'medium'
            },
            {
                'info': [
                    'http://bugs.jquery.com/ticket/11290',
                    'http://research.insecurelabs.org/jquery/test/'
                ],
                'identifiers': {
                    'bug': '11290',
                    'summary': 'Selector interpreted as HTML'
                },
                'severity': 'medium'
            },
            {
                'info': [
                    'https://github.com/jquery/jquery/issues/2432',
                    'http://blog.jquery.com/2016/01/08/jquery-2-2-and-1-12-released/'
                ],
                'identifiers': {
                    'summary': '3rd party CORS request may execute'
                },
                'severity': 'medium'
            }
        ],
        'version': '1.6.0',
        'component': 'jquery'
    }
]

Features

  • Scan remote JavaScript files for known vulnerabilities
  • Detect vulnerable versions of popular JavaScript libraries
  • Comprehensive vulnerability database
  • Easy to integrate into Python projects

Requirements

  • Python 3.6 or higher
  • requests>=2.25.0

Vulnerability Data Updates

The vulnerability data used by UnretiredJS is stored in retirejs/vulnerabilities.py. This data is sourced from the official RetireJS repository (https://raw.githubusercontent.com/RetireJS/retire.js/master/repository/jsrepository.json).

Updates are handled automatically by a GitHub Action defined in .github/workflows/update_retirejs_data.yml. This action runs on a monthly schedule (at 00:00 UTC on the 1st day of every month) to fetch the latest vulnerability information. It also allows for manual triggering via the GitHub Actions UI.

If you need to run the update script manually, follow these steps:

  1. Navigate to the root directory of this repository.
  2. Ensure you have Python 3 installed.
  3. Install the necessary dependencies:
    pip install requests
    
  4. Run the update script:
    python retirejs/update_vulnerabilities.py
    
  5. If the script makes any changes to retirejs/vulnerabilities.py, these changes should be committed to the repository.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Author

Anand Kumar - GitHub

Project details


Download files

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

Source Distribution

unretiredjs-1.4.3.tar.gz (50.3 kB view details)

Uploaded Source

Built Distribution

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

unretiredjs-1.4.3-py3-none-any.whl (51.4 kB view details)

Uploaded Python 3

File details

Details for the file unretiredjs-1.4.3.tar.gz.

File metadata

  • Download URL: unretiredjs-1.4.3.tar.gz
  • Upload date:
  • Size: 50.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for unretiredjs-1.4.3.tar.gz
Algorithm Hash digest
SHA256 f2a1647749f3ecb9e23c464ebb17f3857fd7f9e38bfe2ec56fdca2cbb39588e3
MD5 af0de388c02b21b2711466e547d4cf0b
BLAKE2b-256 8215f06aac47d06465fbd16685cb0b5852dea42321b5ef06d108b55cacc1d08d

See more details on using hashes here.

File details

Details for the file unretiredjs-1.4.3-py3-none-any.whl.

File metadata

  • Download URL: unretiredjs-1.4.3-py3-none-any.whl
  • Upload date:
  • Size: 51.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for unretiredjs-1.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 99db9da78aae709d2ba37ac0a0b106ab079e55090a5c095e4d6ea815ae94eded
MD5 7c5e1c936365277b9686209b0d5f15e0
BLAKE2b-256 429c4562bdc52a8ce57f84b0a286aed3809bcbc9be1b9a8eeb2ee7188ba47506

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page