JDBC session store: InvalidClassException on SecurityContextImpl after Spring Security upgrade (similar to #181, but for SPRING_SESSION_ATTRIBUTES)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
調査の方向性
Start with UaaJdbcSessionConfig and the SPRING_SESSION_ATTRIBUTES.ATTRIBUTE_BYTES serialization path, then compare the JSON-based UaaTokenStore approach from #181. Reproduce the rolling-upgrade failure with an existing JDBC session, and confirm that the session conversion service or serializer can read both SecurityContextImpl versions. Done means old and new sessions remain usable across the upgrade and a regression test covers both serialization directions.
索引モデルが issue の本文から書いたものです。
説明
With servlet.session-store: database, sessions are stored by Spring Session JDBC using JDK serialization. After upgrading UAA to a version with a different Spring Security minor, any request carrying an existing JSESSIONID fails:
at org.springframework.session.jdbc.JdbcIndexedSessionRepository.deserialize
at ...JdbcSession.getAttribute
at ...HttpSessionSecurityContextRepository.loadContext
Caused by: java.io.InvalidClassException: org.springframework.security.core.context.SecurityContextImpl;
local class incompatible: stream classdesc serialVersionUID = 580, local class serialVersionUID = 620
The same happens in both directions during a rolling update. The Thymeleaf error template also reads the session, so the error page fails to render too (TemplateOutputException).
#181 fixed this for oauth_code by storing JSON (UaaTokenStore). SPRING_SESSION_ATTRIBUTES.ATTRIBUTE_BYTES has the same problem. UaaJdbcSessionConfig does not configure a springSessionConversionService or any serializer.
UAA Version - 78.9.0
Full log -
org.thymeleaf.exceptions.TemplateOutputException: An error happened during template rendering
...
Caused by: org.springframework.core.convert.ConversionFailedException: Failed to convert from type [byte[]] to type [java.lang.Object] for value [{...}]
...
at org.springframework.session.jdbc.JdbcIndexedSessionRepository.deserialize(JdbcIndexedSessionRepository.java:689)
at org.springframework.session.jdbc.JdbcIndexedSessionRepository$JdbcSession.getAttribute(JdbcIndexedSessionRepository.java:801)
at org.springframework.session.web.http.HttpSessionAdapter.getAttribute(HttpSessionAdapter.java:102)
at org.springframework.security.web.context.HttpSessionSecurityContextRepository.readSecurityContextFromSession(HttpSessionSecurityContextRepository.java:212)
at org.springframework.security.web.context.HttpSessionSecurityContextRepository.loadContext(HttpSessionSecurityContextRepository.java:126)
...
Caused by: org.springframework.core.serializer.support.SerializationFailedException: Failed to deserialize payload. Is the byte array a result of corresponding serialization for DefaultDeserializer?
...
Caused by: java.io.InvalidClassException: org.springframework.security.core.context.SecurityContextImpl; local class incompatible: stream classdesc serialVersionUID = 580, local class serialVersionUID = 620```
- 主要言語
- Java
- スター
- 1.6k
- フォーク
- 847
- 平均マージ
- 2日 1時間
- マージ済み PR(30日)
- 48
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cloudfoundry/uaa のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
cloudfoundry/uaa#4194 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
cloudfoundry/uaa#4156 ·
メンテナーはふだん 1 日以内に返信
-
Support named allowed-resource policies for mTLS clients対応中かも @strehle が 25 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
cloudfoundry/uaa#4125 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
cloudfoundry/uaa#4086 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
cloudfoundry/uaa#3735 ·
メンテナーはふだん 1 日以内に返信
cloudfoundry/uaa の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
testng-team/testng#3672 ·
メンテナーはふだん 1 日以内に返信
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
eclipse-edc/IdentityHub#1296 ·
メンテナーはふだん 1 日以内に返信
-
area: ui priority: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
tetsuji16/microProject#1721 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
[Bug] [BanyanDB] timestamp.ParseDuration silently drops everything after "d"対応中かも @soujasK が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
apache/skywalking#14287 ·
メンテナーはふだん 1 日以内に返信