
安全功能与代码漏洞
# 安全功能
慕白Lee
业精于勤荒于嬉,行成于思毁于随。 学业由于勤奋而专精,由于玩乐而荒废;德行由于独立思考而有所成就,由于因循随俗而败坏。 ——出自(唐)韩愈《进学解》
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Sonar常见问题及修改建议2021(持续更新!!)
Sonar 全称 SonarQube,是一种静态代码检查工具,采用 B/S 架构,帮助检查代码缺陷,改善代码质量,提高开发速度,通过插件形式,可以支持 Java、C、C++、JavaScript 等二十几种编程语言的代码质量管理与检测。大家都在Idea用sonar插件扫描自己的项目代码,以提高自己的代码质量。本文主要介绍自己在工作中用soanr工具检查JAVA代码时常见的问题及对应修改建议,...原创 2019-12-26 16:22:46 · 7827 阅读 · 0 评论 -
SonarLint: Replace "@RequestMapping(method = RequestMethod.GET)" with "@GetMapping" [+1 location]
Sonar常见问题及修改建议(201912):https://blog.csdn.net/libusi001/article/details/103717457~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~SonarLint: Replace "@RequestMapping(method = RequestMethod.GET)" with "@Get...原创 2020-01-02 15:10:23 · 1483 阅读 · 0 评论 -
simplify简化:can be replaced with
Sonar常见问题及修改建议2021(持续更新!!) https://blog.csdn.net/libusi001/article/details/103717457 有用请点赞,养成良好习惯!鼓励、疑问、交流请留言!原创 2021-09-04 15:50:09 · 956 阅读 · 0 评论 -
SonarLint: Provide the parametrized type for this generic.
Raw use of parameterized class 'PageInfo'Unchecked call to 'PageInfo(List<T>)' as a member of raw type 'com.github.pagehelper.PageInfo'SonarLint: Provide the parametrized type for this generic.原始使用参数化类'PageInfo'未经审核的原始类型'com.github.pagehelper..原创 2020-08-21 11:37:28 · 20343 阅读 · 0 评论 -
Refactor this method to reduce its Cognitive Complexity from 65 to the 15 allowed. [+22 locations]
【代码】Refactor this method to reduce its Cognitive Complexity from 65 to the 15 allowed. [+22 locations]原创 2020-10-22 11:03:35 · 7290 阅读 · 0 评论 -
阿里巴巴Java开发手册踩坑:100篇实例详解
阿里巴巴开发手册华山版GitHub下载链接Java方法等命名规范:https://blog.csdn.net/libusi001/article/details/100122137Java方法注释规范:https://blog.csdn.net/libusi001/article/details/100122163Java魔法值:https://blog.csdn.net/lib...原创 2019-08-28 14:59:59 · 1265 阅读 · 0 评论 -
Variable used in lambda expression should be final
Variable used in lambda expression should be finallambda表达式中使用的变量应该是final错误代码示例lambada里面变量需要是final类型,使用数组传值 绕过这个规则原创 2020-09-25 16:28:38 · 1968 阅读 · 0 评论 -
阿里巴巴Java开发手册实战:Java魔法值
public class Constant { /** * 不要出现魔法值,常量在这里定义 */ /** * 激活状态 */ public static final int STATUS_TRUE = 1; public static final int STATUS_FALSE = 0; /** ...原创 2019-08-28 16:37:42 · 2587 阅读 · 0 评论 -
SonarLint: Replace the type specification in this constructor call with the diamond operator (“<>“).
一、问题SonarLint:用菱形运算符(“ <>”)替换此构造函数调用中的类型规范。显式类型参数BzbxDataInfos可以替换为<>二、解决有用请点赞,养成良好习惯!疑问、交流、鼓励请留言!...原创 2021-09-04 15:43:40 · 2164 阅读 · 0 评论 -
阿里巴巴Java开发手册实战:Java命名规范
阿里巴巴Java开发手册实战:100篇实例详解~~~~~~~~~~~~~~~~~~~~~~~~~~~~Java方法等命名规范原创 2019-08-28 16:36:06 · 938 阅读 · 0 评论 -
登录注册明文不安全
前台js处理形同虚设.解决方案稍后几天给出原创 2019-07-06 17:54:15 · 407 阅读 · 0 评论 -
Spring构造器注入@Autowired
阿里巴巴Java开发手册实战:100篇实例详解~~~~~~~~~~~~~~~~~~~~~~~~~~~~ private final SpecialSingleChoiceQuestionService specialSingleChoiceQuestionService; private final SpecialPaperAndQuestionService specia...原创 2019-12-11 15:50:40 · 758 阅读 · 0 评论 -
Use try-with-resources or close this “BufferedOutputStream“ in a “finally“ clause.
Sonar常见问题及修改建议(202001):https://blog.csdn.net/libusi001/article/details/103717457~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~一、报错信息Use try-with-resources or close this "BufferedOutputStream"...原创 2020-01-05 23:20:43 · 18369 阅读 · 0 评论 -
Type may be primitive
Sonar常见问题及修改建议2021(持续更新!!) https://blog.csdn.net/libusi001/article/details/103717457 类型可能是原始的有用请点赞,养成良好习惯!疑问、交流、鼓励请留言!原创 2021-09-04 15:45:57 · 3817 阅读 · 0 评论 -
SonarLint: Save and re-use this “Random“.
Sonar常见问题及修改建议2021(持续更新!!) https://blog.csdn.net/libusi001/article/details/103717457 SonarLint:保存并重复使用此“随机”。初次更改为:改造后:验证:重用随机数成功! private static Random rand; static { try { rand = SecureRandom.getInstan.原创 2021-09-04 15:52:23 · 9559 阅读 · 3 评论 -
SonarLint漏洞及修复01:代码优化
1、Use try-with-resources or close this “BufferedOutputStream“ in a “finally“ clause.使用try-with-resources或在“ finally”子句中关闭此“ BufferedOutputStream”。https://blog.csdn.net/libusi001/article/details/1038489222、SonarLint: Replace the type specification i.原创 2020-08-18 11:32:16 · 9216 阅读 · 1 评论 -
Flash AllowScriptAccess 参数
安全漏洞汇总50篇博客:https://blog.csdn.net/libusi001/article/details/100761232~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~一、漏洞简述AllowScriptAccess 参数 AllowScriptAccess 参数有 “always”、”sameDomain” 和 “never” 这三个。...原创 2019-07-06 17:50:10 · 2454 阅读 · 0 评论 -
SonarLint: Use the built-in formatting to construct this argument
Sonar常见问题及修改建议2021(持续更新!!) https://blog.csdn.net/libusi001/article/details/103717457 SonarLint:使用内置格式来构造此参数。改造: String key = hashMap.get("key"); String key2 = hashMap.get("key2"); String key3 = hashMap.get("key3");.原创 2021-09-04 15:54:04 · 1657 阅读 · 7 评论 -
Sonar:Merge this if statement with the enclosing one
Sonar常见问题及修改建议(201912):https://blog.csdn.net/libusi001/article/details/103717457~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~一、问题Merge this if statement with the enclosing one应该合并可折叠的"if"语句二、示例...原创 2019-12-26 16:19:03 · 7532 阅读 · 0 评论 -
权限控制集中解决方案
一、权限漏洞二、解决方案三、权限控制原创 2020-03-04 23:46:59 · 535 阅读 · 0 评论 -
‘if‘ statement can be simplified SonarLint: Replace this if-then-else statement by a single return
Sonar常见问题及修改建议(201912):https://blog.csdn.net/libusi001/article/details/103717457~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~一、报错提示'if' statement can be simplified SonarLint: Replace this if-then-e...原创 2020-01-02 18:16:42 · 16634 阅读 · 2 评论 -
使用@Autowired注解警告Field injection is not recommended
Field injection is not recommended不建议现场主入Field injection is not recommended Inspection info: Spring Team recommends: "Always use constructor based dependency injection in your beans. Always use assertions for mandatory dependencies".始终在bean中使用基..原创 2020-09-29 16:25:34 · 1043 阅读 · 0 评论 -
SpringBoot防止表单重复提交:添加拦截器验证Token
一、背景二、token.java三、拦截器四、应用实例原创 2020-01-19 17:13:36 · 1154 阅读 · 0 评论 -
阿里巴巴Java开发手册实战:Java注释规范实例
阿里开发手册:Java注释规范实例原创 2019-08-28 16:37:08 · 1055 阅读 · 0 评论 -
SonarLint: Remove this empty statement.Unnecessary semicolon ‘;‘
Sonar常见问题及修改建议2021(持续更新!!) https://blog.csdn.net/libusi001/article/details/103717457 SonarLint:删除此空语句。不必要的分号';'有用请点赞,养成良好习惯!疑问、交流、鼓励请留言!...原创 2021-09-04 15:47:37 · 1088 阅读 · 0 评论 -
Fastjson开启安全模式5种方法(VIP典藏版)
一、Fastjson漏洞事件始末1、AutoType2、AutoType是谁-为啥使用-为啥出错3、目前已升级至1.2.83二、打开SafeMode功能1. 在代码中配置2. 加上JVM启动参数3. 通过fastjson.properties文件配置。4. safeMode场景如何做autoType5. 怎么判断是否用到了autoType6. 使用JSONType.autoTypeCheckHandler......原创 2021-06-08 17:39:59 · 14543 阅读 · 12 评论 -
OWASP TOP12之注入问题Injection(1)
OWASP TOP12 学习与分享:https://blog.csdn.net/libusi001/article/details/103052691~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~目录一、SQL注入常见位置:二、SQL注入示例三、动态SQL问题解决四、框架Mybatis五、mybatis中的#和$的区别...原创 2019-11-24 18:01:14 · 792 阅读 · 0 评论 -
OWASP TOP12 详解分享2019
背景: Java平台设计因素之一就是为了提供一个安全的代码环境。虽然Java自身的安全体系结构侧重于保护用户和系统免受网络上的恶意程序攻击。但是如果受信任的代码执行错误指令信息,则会不可避免的造成安全问题。 这样的安全问题,往往包含在JAVA应用之中,包括访问文件、控制打印机、控制摄像头、拒绝服务、系统执行恶意删除命令等。追其根源大部分都是编码设计中出现了纰漏。 为...原创 2019-11-13 17:04:46 · 1347 阅读 · 0 评论 -
OWASP TOP12之跨站问题(2):
OWASP TOP12 学习与分享:https://blog.csdn.net/libusi001/article/details/103052691~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~一、简介 XSS攻击通常指的是通过利用网页开发时留下的漏洞,通过巧妙的方法注入恶意指令代码到网页,使用户加载并执行攻击者恶意制造的...原创 2019-11-24 18:49:30 · 367 阅读 · 0 评论 -
跨域问题解决
一、Java跨域问题原创 2020-01-19 17:14:37 · 370 阅读 · 0 评论 -
安全漏洞汇总50篇博客
Flash AllowScriptAccess 参数:https://blog.csdn.net/libusi001/article/details/94877113登录注册明文不安全:https://blog.csdn.net/libusi001/article/details/94877897原创 2019-09-12 08:56:19 · 670 阅读 · 0 评论 -
源代码漏洞总结及解决方法200篇
源代码漏洞总结及解决方法200篇一.前端系列不安全的随机数 二.后台系列 ...原创 2020-03-23 17:05:55 · 1294 阅读 · 1 评论