PYB11Generator

v2026.5.0 suspicious
4.0
Medium Risk

PYB11Generator is a code generation tool which generates pybind11 code for binding C++ to Python. Documentation is available at https://pyb11generator.readthedocs.io/

🤖 AI Analysis

Final verdict: SUSPICIOUS

The package exhibits moderate risk due to potential code obfuscation and questionable metadata, but no direct evidence of malicious intent or network/shell abuse beyond expected functionality was found.

  • High obfuscation risk due to use of eval()
  • Inadequate maintainer metadata
Per-check LLM notes
  • Network: No network calls were detected.
  • Shell: The shell execution patterns seem to be related to package build and documentation generation processes.
  • Obfuscation: The code employs unusual and potentially misleading patterns involving eval() which can be used for obfuscation.
  • Credentials: No suspicious patterns indicating credential harvesting were found.
  • Metadata: The maintainer has a new or inactive account and lacks a proper author name, which may indicate low activity or oversight.

🔬 Heuristic Checks

Outbound Network Calls

No suspicious network call patterns found

Code Obfuscation score 10.0

Found 6 obfuscation pattern(s)

  • x in dir(klass) if isinstance(eval("klass.%s" % x, globs, locs), PYB11ClassAttribute) and x in
  • initions # klasses = [(x, eval("klass.%s" % x)) for x in dir(klass) if (inspect.isclass(eva
  • ir(klass) if (inspect.isclass(eval("klass.%s" % x)) and x in klass.__dict__)] # for (kname,
  • methattrs["returnType"] = eval("bklassinst." + mname + "()") assert methattrs["
  • in dir(modobj) if isinstance(eval("modobj.%s" % x, globs, locs), PYB11attr)] if stuff:
  • stuff: inst = eval("modobj.%s" % pyname) inst(pyname, ss)
Shell / Subprocess Execution score 10.0

Found 6 shell execution pattern(s)

  • 1 = dt.datetime.now() os.system( "g++ -Os -shared -rdynamic -undefined dynamic_l
  • (build_dir) try: subprocess.call(["doxygen", "--version"]) retcode = subprocess.call(
  • -version"]) retcode = subprocess.call(["doxygen"], cwd=app.confdir) if retcode < 0:
  • keypatch.chdir(MAIN_DIR) subprocess.run( [sys.executable, "-m", "build", "--sdist", f"--outd
  • with build_global(): subprocess.run( [ sys.executable,
  • keypatch.chdir(MAIN_DIR) subprocess.run( [sys.executable, "-m", "build", "--wheel", "--outdi
Credential Harvesting

No credential harvesting patterns detected

Typosquatting

No typosquatting candidates detected

Registered Email Domain

Email domain looks legitimate: llnl.gov>

Suspicious Page Links

All external links appear legitimate

Git Repository History

Repository LLNL/PYB11Generator appears legitimate

Maintainer History score 4.0

2 maintainer concern(s) found

  • Author name is missing or very short
  • Author "" appears to have only 1 package on PyPI (new or inactive account)
Known CVE Vulnerabilities

No known vulnerabilities found in OSV database.

💡 AI App Starter Prompt

Use this prompt to build a project with PYB11Generator
Create a mini-application that automates the process of generating pybind11 bindings for a given set of C++ classes and functions. This application will serve as a quick way to interface C++ code with Python, making it easier to leverage the performance benefits of C++ while still being able to use Python's flexibility and ease of use.

The application should include the following core functionalities:
- A user-friendly command-line interface where users can input the path to their C++ header files.
- An option to specify which classes and functions from the header files should be exposed to Python.
- Generation of corresponding pybind11 binding code based on the specified C++ elements.
- Integration with PYB11Generator to streamline the code generation process.
- Support for adding custom decorators to the generated bindings for additional functionality like property getters and setters, or custom converters.

Additional features could include:
- Automatic detection of commonly used C++ types and providing pre-defined bindings for them.
- Validation of the generated pybind11 code before attempting to compile it into a Python module.
- A feature to generate unit tests for the Python bindings using a simple template system.
- Option to output the generated bindings directly into a Python file or a separate C++ source file that can be compiled separately.

Your task is to design and implement this application from scratch, utilizing PYB11Generator to handle the heavy lifting of code generation. Ensure that the application is well-documented, including examples of how to use it effectively. Additionally, provide instructions on setting up the environment for both the C++ and Python parts of the project.