apache / apache/hop

[Task]: Disable external entity resolution by default in the XSD Validator transform and action

Closed
#8,367 1 comment 0 reactions 1 assignee Claimed by @bamaer View on GitHub
P2 Transforms
Dominant language
Java
Stars
1.5k
Forks
476
Avg merge
18h 32m
Merged PRs (30d)
216

Description

### What needs to happen?

XSD validation resolves external entities unless explicitly turned off. The
default comes from `ALLOW_EXTERNAL_ENTITIES_FOR_XSD_VALIDATION_DEFAULT`, which
is `"true"` in both places it is defined:

- `transforms/xml/.../xsdvalidator/XsdValidatorMeta.java:62` (XSD Validator transform)
- `actions/xml/.../xsdvalidator/XsdValidator.java:76` (XSD Validator action)

Both have the hardened configuration already implemented — a secure
`SchemaFactory`, `disallow-doctype-decl`, external general and parameter
entities off, and a rejecting entity resolver (transform:
`XsdValidator.java:137-168`, action: `XsdValidator.java:135-166`). In both it is
gated behind the flag being false, so with the current default it never runs and
the unsecured `SchemaFactory` is selected instead.

The fix is therefore the default value, not the implementation: change both
constants to `"false"`.

### Issue Priority

Priority: 2

### Issue Component

Component: Transforms

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.