Verify CVE-free dependency floors when a project is created

Open
#706 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
68/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active

Research direction

Start by reading scripts/audit_floors.py, nexy/modules/cli/templates/_shared/web/pyproject.toml.jinja2, the api variant’s package.json.jinja2, and the floor list in docs/reference/security.md. Trace project creation to find where shared audit logic can run online and where floors and the offline command can be emitted. Done means generated projects receive the documented floors, advisories block scaffolding, and tests cover exact outputs, a fake OSV advisory, and the offline message.

Written by the indexing model from the issue text.

Description

area:cli dependencies difficulty:advanced enhancement

Problem

Generated projects depend on nexy>=<version> and ORM packages with no minimum versions chosen for security. The framework repository audits its floors with OSV and pip-audit, but a project a user just created never gets that check.

What we know

  • nexy/modules/cli/templates/_shared/web/pyproject.toml.jinja2 and the api variant declare nexy>=<version> plus ORM and driver packages.
  • scripts/audit_floors.py lines 20 to 92 reads floor versions from the root pyproject.toml and the generated package.json.jinja2, queries https://api.osv.dev/v1/querybatch, and fails when a floor has an advisory.
  • docs/reference/security.md lines 5 to 21 lists the floors and the reason for each.
  • Generated projects do not carry the floors or the audit.

Proposal

  • Give generated projects the same CVE-free floors the framework uses, for Python and for JavaScript packages.
  • Share the OSV audit logic between the repository script and the scaffold, instead of copying it.
  • Run the check when a project is created while online; offline, write the floors and print the command to run the check later.

Acceptance

  • A test asserts the exact floors written into a generated pyproject.toml and package.json.
  • A test uses a fake OSV response to prove an advisory blocks the scaffold.
  • A test covers the offline path and its message.
  • No advisory is ignored without a dated entry in SECURITY.md.
Dominant language
Python
Stars
11
Forks
6
Avg merge
2h 14m
Merged PRs (30d)
265

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NexyPy/nexy

All issues in NexyPy/nexy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.