Skip to content

[BUG] ExternalReferenceType misspells 'rfc-9116' enum member as RFC_9166 instead of RFC_9116 #1074

In review

Description

@trackoor

cyclonedx.model.ExternalReferenceType defines the CycloneDX 1.6+ 'rfc-9116' external reference type with transposed digits as RFC_9166 instead of RFC_9116, so accessing ExternalReferenceType.RFC_9116 raises AttributeError.

pip install cyclonedx-python-lib==11.12.0
python3 - <<'PY'
from cyclonedx.model import ExternalReferenceType

print("Member for 'rfc-9116':", ExternalReferenceType("rfc-9116").name)
assert not hasattr(ExternalReferenceType, "RFC_9116")
PY

Actual output:

Member for 'rfc-9116': RFC_9166

Expected ExternalReferenceType.RFC_9116 with .name == 'RFC_9116' and .value == 'rfc-9116', matching the CycloneDX externalReferenceType schema value 'rfc-9116' (https://cyclonedx.org/docs/1.7/xml/#type_externalReferenceType) and the UPPER_SNAKE_CASE naming of the other ExternalReferenceType members.

Tested with cyclonedx-python-lib 11.12.0 (45da84afdf) on Linux with Python 3, and verified unchanged in main (3d62bf6723).

In cyclonedx/model/__init__.py line 517 (and _ExternalReferenceSerializationHelper.__CASES at line 589), the enum member is spelled RFC_9166 = 'rfc-9116' (missed by TestEnumExternalReferenceType.test_knows_value in tests/test_enums.py because _test_knows_value only checks ExternalReferenceType(value)).

Found with a differential-testing tool; the report was drafted with AI assistance and reviewed and edited by me.

Credit: https://ucsbplse.github.io/

Activity

  1. jkowalleck commented on Nov 25, 2026

    @jkowalleck
    Member

    yep, this is a bug.

    RFC_9166 = 'rfc-9116' # Only supported in >= 1.6

    RFC_9166 should be RFC_9116

    A bug fix would be a breaking change. this is not a blocker, just a remark

  2. added theissue type on Nov 25, 2026
  3. added
    bug
    good first issue
    help wanted
    on Nov 25, 2026
  4. changed the title [-]ExternalReferenceType misspells 'rfc-9116' enum member as RFC_9166 instead of RFC_9116[/-] [+][BUG] ExternalReferenceType misspells 'rfc-9116' enum member as RFC_9166 instead of RFC_9116[/+] on Nov 25, 2026
  5. jkowalleck commented on Nov 25, 2026

    @jkowalleck
    Member

    this library is a community effort - feel free to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking changebuggood first issuehelp wanted

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions