Skip to content

Saml-Metadata with special characters is corrupted #13776

@JannickWeisshaupt

Description

@JannickWeisshaupt

Describe the bug
Saml metadata is corrupted once it contains special characters.

To Reproduce

  1. Configure the metadata to contain special characters, e.g. via OpenSamlMetadataResolver.EntityDescriptorParameters.
  2. Generate the metadata via /saml2/service-provider-metadata/{descriptor}
  3. The metadata is corrupted and invalid xml

Expected behavior
The metadata is not corrupted, valid xml and obeys the Saml Standard

Cause
In Saml2MetadataFilter Line 111
response.setContentLength(metadata.getMetadata().length());
is generally wrong as the length in bytes is required which differs from Java String length, e.g. "ä".length() = 1 but should be 2

Metadata

Metadata

Labels

in: saml2An issue in SAML2 modulestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions