Skip to content

Remove sensitive XML attributes (password/pwd) in REST API responses#467

Closed
apeiris wants to merge 2 commits into
OpenAS2:masterfrom
apeiris:master
Closed

Remove sensitive XML attributes (password/pwd) in REST API responses#467
apeiris wants to merge 2 commits into
OpenAS2:masterfrom
apeiris:master

Conversation

@apeiris

@apeiris apeiris commented Aug 28, 2025

Copy link
Copy Markdown
Contributor

Remove any sensitive entries (password/pwd) returned from Properties.getProperties() in getPropertyList().

Updated getXml() to recursively redact sensitive XML attributes (password or pwd) before returning the XML response.

Introduced redactSensitiveAttributes(Node node) helper method to traverse nodes and remove sensitive attributes.

- Introduced /getPropertyList endpoint returning application properties as JSON.
- Introduced /getXml endpoint returning XML content filtered via XPath.
- Added HTTPS enforcement for non-localhost requests to prevent exposure of sensitive information.
- Implemented isLocalhost(Request) helper for local testing exceptions.
- Added XML parsing with XXE protection.
- Updated imports and cleaned up unused imports.
}

@GET
@RolesAllowed({"ADMIN"})

Check failure

Code scanning / CodeQL

XPath injection Critical

XPath expression depends on a
user-provided value
.
@apeiris apeiris closed this Aug 28, 2025
@apeiris

apeiris commented Aug 28, 2025

Copy link
Copy Markdown
Contributor Author

Closing to resolve CodeQL issue

@apeiris apeiris reopened this Aug 28, 2025
@apeiris

apeiris commented Aug 28, 2025

Copy link
Copy Markdown
Contributor Author

Closing to resolve CodeQL issue

@apeiris apeiris closed this Aug 28, 2025
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.

2 participants