@Override
    public InputStream open(String path) throws IOException {
        try (InputStream in = delegate.open(path)) {
            final String config = new String(in.readAllBytes(), StandardCharsets.UTF_8);
            final String substituted = substitutor.replace(config);

            return new ByteArrayInputStream(substituted.getBytes(StandardCharsets.UTF_8));
        }
    }
@Test
    void shouldNotBeVulnerableToCVE_2022_42889() throws IOException {
        StringLookup dummyLookup = (x) -> null;
        SubstitutingSourceProvider provider = new SubstitutingSourceProvider(new DummySourceProvider(), new StringSubstitutor(dummyLookup));

        assertThat(provider.open("foo: ${script:javascript:3 + 4}")).hasSameContentAs(new ByteArrayInputStream("foo: ${script:javascript:3 + 4}".getBytes(StandardCharsets.UTF_8)));
    }