Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow_custom is not inherited to common properties #498

Closed
EfstratiosLontzetidis opened this issue Mar 7, 2021 · 1 comment · Fixed by #503
Closed

allow_custom is not inherited to common properties #498

EfstratiosLontzetidis opened this issue Mar 7, 2021 · 1 comment · Fixed by #503

Comments

@EfstratiosLontzetidis
Copy link

The issue is that the allow_custom=True is not inherited in common properties that contain custom_properties.
Common STIX properties allow for adding custom properties using the allow_custom=True option. So, STIX does not restrict us for adding custom properties in a Common STIX property.

An example to reproduce the issue is:

  1. Create an "External Reference" common property and add some custom properties
  2. Create a Malware SDO and add the external-reference of the previous step.
  3. Save the Malware SDO to a json file
  4. Try to parse this Malware SDO via obj = parse(file_handle, allow_custom=True)

The error that is returned is the following:
"stix2.exceptions.InvalidValueError: Invalid value for Malware 'external_references': Unexpected properties for ExternalReference: (customizedproperty)."

This might be related to the issue #176 and issue #333.
I apologize if it is a false positive and I am doing something wrong. Please let me know what I should do.

The json file is the following:

    "type": "malware",
    "spec_version": "2.1",
    "id": "malware--83687fef-12ec-4959-94fe-a4f1c1380747",
    "created": "2021-03-06T18:54:28.533Z",
    "modified": "2021-03-06T18:54:28.533Z",
    "name": "malware-test-inheritance-of-custom-property",
    "description": "test-inheritance-of-custom-property",
    "is_family": false,
    "first_seen": "2021-03-06T18:54:28.533Z",
    "external_references": [
        {
            "source_name": "test-inheritance-custom",
            "description": "test for inheritance",
            "customizedproperty": "acustomproperty"
        }
    ]
}
@clenk
Copy link
Contributor

clenk commented Jun 11, 2021

This should now be fixed in #503.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants