fix: 修复多个安全缺陷和功能问题

- 移除加密相关代码(服务端和所有客户端)
- 修复 JWT 验证未检查签名算法的问题
- 修复重置密码使用不安全随机数的问题
- 实现 Logout 服务端失效机制
- 修复历史版本对比 diff 颜色标记错误
- 修复占位符解析循环引用风险
- 添加用户禁用状态检查
- 更新 bug 清单文档
This commit is contained in:
2026-03-10 21:07:22 +08:00
parent f41d53da41
commit 932db9fbdc
27 changed files with 292 additions and 721 deletions
+3 -2
View File
@@ -6,7 +6,7 @@ import (
"kenaito-conf/server/internal/model"
"kenaito-conf/server/internal/service"
"kenaito-conf/server/internal/util"
"math/rand"
"crypto/rand"
"net/http"
"strconv"
"time"
@@ -341,8 +341,9 @@ func (h *UserHandler) Options(c *gin.Context) {
func randomString(n int) string {
const letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
b := make([]byte, n)
_, _ = rand.Read(b)
for i := range b {
b[i] = letters[rand.Intn(len(letters))]
b[i] = letters[int(b[i])%len(letters)]
}
return string(b)
}