Trust framework types by default in AllowListDeserializingConverter
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Start by reading AllowListDeserializingConverter and JacksonMessagingUtils.DEFAULT_TRUSTED_PACKAGES, then trace its constructors and the PayloadDeserializingTransformer.setDeserializer() path. Check the int-jdbc:message-store schema and its tests for the optional allow-list attribute. Done means defaults are seeded, custom patterns can be added or replace defaults, blank patterns are rejected, and the security message and whats-new documentation cover the behavior change.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Expected Behavior
AllowListDeserializingConverter should allow a default set of trusted framework and JDK types to be deserialized, instead of allowing all classes when no patterns are configured.
Any component built on it then gets a default without configuration changes:
PayloadDeserializingTransformerJdbcMessageStoreandJdbcChannelMessageStoreMongoDbMessageStoreBinaryToMessageConverterSerializingHttpMessageConverter
Users add their own types with addAllowedPatterns():
JdbcMessageStore store = new JdbcMessageStore(dataSource);
store.addAllowedPatterns("com.example.model.*");
The "*" pattern remains the explicit opt-out to allow all classes.
Current Behavior
If no patterns are configured, AllowListDeserializingConverter deserializes every class. Every store and transformer built on it is unrestricted unless the user explicitly configures patterns.
Proposed changes:
- Add a
DEFAULT_ALLOWED_PATTERNSconstant toAllowListDeserializingConverter, inspired byJacksonMessagingUtils.DEFAULT_TRUSTED_PACKAGES. - Seed all existing constructors with these defaults.
- Use
addAllowedPatterns()adding to the defaults. - Make
setAllowedPatterns()replace the defaults, so the list can be narrowed. - Reject empty or blank patterns.
- Preserve the patterns when
PayloadDeserializingTransformer.setDeserializer()is called. - Add an optional allow-list attribute to
<int-jdbc:message-store>. - Make the
SecurityExceptionmessage point toaddAllowedPatterns().
The proposed default list adapts the Jackson one. Java deserialization checks every class in the object graph, so it also needs org.springframework.messaging.*, and entries use the * pattern syntax:
public static final List<String> DEFAULT_ALLOWED_PATTERNS = List.of(
"java.util.*",
"java.lang.*",
"org.springframework.messaging.*",
"org.springframework.integration.support.*",
"org.springframework.integration.message.*",
"org.springframework.integration.store.*",
"org.springframework.integration.history.*",
"org.springframework.integration.handler.*");
This is a runtime behavior change. Applications that store or deserialize their own types (payloads, header values, exception types in stored ErrorMessages) will get a SecurityException on read until they add their packages. That includes messages already in a store. The change will be documented in whats-new.
- Lingua principale
- Java
- Stelle
- 1.6k
- Fork
- 1.2k
- Merge medio
- 19h 31m
- PR unite (30g)
- 75
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di spring-projects/spring-integration
-
MQTT v5 outbound adapter drops the trace context that the integration observation puts into the messageForse già presa @Hyunsdb l’ha presa 2 giorni fa. Apertain: mqtt type: enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
spring-projects/spring-integration#11562 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
MySqlTxTimeoutMessageStoreTests.concurrentPolling repeatedly times out during JDBC module testsAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
spring-projects/spring-integration#11553 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Add Java DSL for `spring-integration-mqtt-client` moduleForse già presa @yeomin4242 l’ha presa 6 giorni fa. Apertaideal-for-user-contribution in: dsl in: mqtt type: enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
spring-projects/spring-integration#11537 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
status: waiting-for-reporter type: enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
spring-projects/spring-integration#10672 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
in: sftp type: enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
spring-projects/spring-integration#9971 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di spring-projects/spring-integration
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
strimzi/strimzi-kafka-operator#13328 · 1 commento · 3 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
OpenLiberty/ci.maven#2137 ·
I maintainer di solito rispondono entro 1 giorno
-
Payer adjustment can exceed the balance left after copay and deductible, so claim payments add up to more than the chargeForse già presa @DG47 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
synthetichealth/synthea#1772 ·
I maintainer di solito rispondono entro 13 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
geonetwork/core-geonetwork#9592 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
NationalSecurityAgency/ghidra#10040 ·
I maintainer di solito rispondono entro 2 giorni