Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Trust framework types by default in AllowListDeserializingConverter

Aperta
#11,534 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@cppwfs ci sta già lavorando.

Dal 26/10/2026.

  • #11620 di @cppwfs — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java, spring
Ambito
backend, security

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

in: core in: ftp in: jdbc in: mongodb type: enhancement
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:

  • PayloadDeserializingTransformer
  • JdbcMessageStore and JdbcChannelMessageStore
  • MongoDbMessageStore
  • BinaryToMessageConverter
  • SerializingHttpMessageConverter

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_PATTERNS constant to AllowListDeserializingConverter, inspired by JacksonMessagingUtils.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 SecurityException message point to addAllowedPatterns().

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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di spring-projects/spring-integration

Tutte le issue di spring-projects/spring-integration

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.