Skip to content

fix(ibm-define-required-properties): avoid disclosing referenced content in messages - #876

Closed
pyrooka wants to merge 1 commit into
mainfrom
fix/required-property-ref-disclosure
Closed

pyrooka wants to merge 1 commit into
mainfrom
fix/required-property-ref-disclosure

Conversation

@pyrooka

@pyrooka pyrooka commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

The ibm-define-required-properties rule puts each unmatched required entry into its error message. If an entry is a $ref to a file or URL, the resolved content ends up in the output, so a spec with required: [{ $ref: 'file:/some/local/file' }] makes the validator print that file. It's the same kind of problem as the earlier allOf fix in merge-allof-schema-properties.

Now the rule checks where each entry came from. If it was loaded from a different document than the list it sits in, or we can't tell, the message says <referenced value>. Entries written directly in the spec, including ones in external schema files, still show the real name. I added a test that points an entry at a temp file and checks the content isn't in the message.

This only changes what gets printed. The $refs are still resolved, and other rules that put spec values in their messages are not covered here.

…ent in messages

Do not echo entries of a schema's required list that were pulled in via $ref (e.g. file contents) in the rule's error message (CWE-209).

Signed-off-by: Norbert Biczo <pyrooka@users.noreply.github.com>
@pyrooka pyrooka closed this Nov 19, 2026
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 this pull request may close these issues.

1 participant