fortify——J2EE Bad Practices: Non-Serializable Object Stored in Session
来源:互联网 发布:淘宝买东西受骗怎么办 编辑:程序博客网 时间:2024/06/05 00:33
J2EE错误实践:存储在会话中的非可序列化对象
Explanation:
J2EE JVM JVM J2EE JVM HttpSession JVM JVM
public class DataGlob {String globName;String globValue;public void addToSession(HttpSession session) {session.setAttribute("glob", this);}}
Recommendations:
public class DataGlob implements java.io.Serializable {String globName;String globValue;public void addToSession(HttpSession session) {session.setAttribute("glob", this);}}
分析
对于不需要将对象序列化到同一jvm以外的应用场景,以上代码没有问题。然而考虑到系统的扩展性,以上问题应该予以避免。
以下是一些常见的会导致问题的场景:
1.
在一些大型应用系统的实现里,会考虑将部分SESSION里的对象钝化到数据库、磁盘里。
2.
在非session-sticky的集群环境里,应用服务器会在集群里广播、复制session数据
修正
0 0
- fortify——J2EE Bad Practices: Non-Serializable Object Stored in Session
- Non-transient non-serializable instance field in serializable class sonar
- fortify——Insecure Randomness
- fortify——password Management
- fortify——Unreleased Resource: Streams
- Session object destruction failed in
- fortify
- ZK SpreadSheet PWC2788: setAttribute: Non-serializable attribute with name javax.zkoss.zk.ui.Session
- FreeSwitch LUA API ——Non-Session API
- Non-Maximum Suppression for Object Detection in Python
- Non-Maximum Suppression for Object Detection in Python
- Stored Procedures in SQLite
- SQL SERVER – Stored Procedure Optimization Tips – Best Practices
- hdu1066——Last non-zero Digit in N!
- J2EE基础之——cookie和session
- Debug stored procedure in VS2005
- Use Stored Procedure in JPA
- Externally Stored Fields in InnoDB
- Android on the transplant ghostscript-9.04 static compiler
- 单例模式实现:枚举单例
- C Datastructure 5 ---- stack
- 剑指offer 求1+2+3+...+n
- Codeforces 789E The Great Mixing (数推倒公式 + bfs + 剪枝)
- fortify——J2EE Bad Practices: Non-Serializable Object Stored in Session
- 在Android Studio中进行单元测试和UI测试
- $.parser.setParserOptions()的实现
- 深度增强学习:走向通用人工智能之路
- 1、uboot的目录分析
- 从GitHub上下载单个文件
- KNN(K-Nearest Neighbor)算法Matlab实现
- ord()和chr()对中文字符的应用
- 如何准备BAT技术面试答案(中)——Java研发方向