vulnlog modify copy

vulnlog modify copy copies vulnerability entries from a source Vulnlog file into one or more target files. In each target, a copied entry lists only the last release of that target.

Synopsis

vulnlog modify copy <source> <destinations>... --vuln-id <id> [--vuln-id <id>...]

Arguments and options

Name Value Default Description

<source>

A Vulnlog file

required

File to copy the entries from.

<destinations>

One or more Vulnlog files

required

Files to copy the entries into.

--vuln-id

A vulnerability ID

required

ID of an entry to copy. Repeatable. The source must have an entry with this ID.

For global options and standard input and output, see Global options and Standard input and output.

Behaviour

A copied entry that’s new to a target goes to the top of its vulnerabilities list. Its releases is set to the last release listed under the target’s releases, published or not. Every other field is copied as it is.

If the target already has an entry with the same ID, that entry keeps its place and its own values, and only gains what it lacks:

  • releases is set to the target’s last release.

  • aliases, packages, and tags gain the values the source has and the target lacks.

  • name, description, analysis, analyzed_at, resolution, and comment take the source value only when the target has none.

  • The verdict, and with it severity, disposition, and justification, stays as the target has it.

  • Reports are matched by reporter. A report the target lacks is added. A report the target has gains the source’s vuln_ids, and any of at, source, and suppress it lacks.

The target must define every tag the copied entries use. Otherwise, the target no longer passes validation after the copy, and the next command that reads it fails.

The command writes each target in the canonical style of vulnlog fmt and removes YAML comments, with a warning.

Exit codes

Code When

0

The entries were copied.

1

A general error, or the source has no entry with an ID you pass. For the general errors, see Exit codes.

2

The source or a target doesn’t pass validation.

Examples

acme-shop-3.vl.yaml is the Vulnlog file of the 3.x release line of Acme Shop. It defines the tags backend and container and the releases 3.9.0 and 3.9.1. Copy the Spring4Shell entry from acme-shop.vl.yaml into it:

$ vulnlog modify copy acme-shop.vl.yaml acme-shop-3.vl.yaml --vuln-id CVE-2022-22965
Copied: 1 entry to acme-shop-3.vl.yaml

The entry is now at the top of vulnerabilities in acme-shop-3.vl.yaml and lists 3.9.1, the last release of the target:

vulnerabilities:

  - id: CVE-2022-22965
    name: Spring4Shell
    description: Remote code execution through data binding in Spring Framework
    releases: [3.9.1]
    packages: ["pkg:maven/org.springframework/spring-beans@5.3.15"]
    reports:
      - reporter: trivy
        at: 2026-04-07
        suppress:
          expires_at: 2027-03-31
    tags:
      - backend
      - container
    analysis: >-
      Acme Shop runs as a Spring Boot executable JAR on JDK 17. The published exploit needs a WAR deployment on Apache Tomcat,
      but Spring advises all users to upgrade.
    analyzed_at: 2026-04-08
    verdict: affected
    severity: medium
    disposition: will fix
    comment: Planned for 4.4.0 together with the Spring Boot update.

Copy two entries into two targets at once:

$ vulnlog modify copy acme-shop.vl.yaml acme-shop-2.vl.yaml acme-shop-3.vl.yaml --vuln-id CVE-2022-22965 --vuln-id CVE-2022-42889
Copied: 2 entries to acme-shop-2.vl.yaml
Copied: 2 entries to acme-shop-3.vl.yaml

An ID the source doesn’t have stops the command, and no file changes:

$ vulnlog modify copy acme-shop.vl.yaml acme-shop-3.vl.yaml --vuln-id CVE-2099-0001
error: vulnerability IDs not found in acme-shop.vl.yaml: CVE-2099-0001
  hint: copy only IDs the source file records