Duplicate controls when importing from resolved profile

Open
#360 0 comments 0 reactions 1 assignee View on GitHub

@selenaxiao-nist is already working on this.

Since Aug 12, 2026.

  • #362 by @selenaxiao-nist — merged

Assessment

This issue has not been assessed yet.

Description

bug

Cloning https://github.com/usnistgov/oscal-cli/issues/315
ProfileResolver doesn't resolve profiles correctly in the following case:

Describe the bug

A produced profile can have multiple copies of controls

When does this occur?

When importing from a resolved profile.

How do we replicate the issue?

The specific steps I used to find this issue were:

  1. oscal-cli profile resolve --to=xml liboscal-java/src/test/resources/content/test-oscal-version-profile.xml source-profile.xml
  2. Create another profile (say, derived-profile.xml)
  3. Have <import href="source-profile.xml> <include-all /> </import> inside derived-profile.xml
  4. oscal-cli profile resolve --to=xml derived-profile.xml
  5. Lo and behold, the generated profile has duplicates of the controls in it

source-profile.xml
derived-profile.xml

Expected behavior (i.e. solution)

Only one set of controls from the imported profile in the resolved profile

Dominant language
Java
Stars
42
Forks
19
Avg merge
1d 13h
Merged PRs (30d)
8

Contributor guide

Open the contributing guide

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 usnistgov/liboscal-java

All issues in usnistgov/liboscal-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.