Spaces:
Running
Running
Add 3 files
Browse files- README.md +7 -5
- index.html +786 -19
- prompts.txt +2 -0
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: projectdetail3
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: green
|
| 5 |
+
colorTo: purple
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,786 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="zh-CN">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>风险项目详情 - AI SDL数字分身</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
|
| 9 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js"></script>
|
| 10 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/github.min.css">
|
| 11 |
+
<style>
|
| 12 |
+
.content-container {
|
| 13 |
+
height: calc(100vh - 180px);
|
| 14 |
+
overflow-y: auto;
|
| 15 |
+
}
|
| 16 |
+
.risk-highlight {
|
| 17 |
+
background-color: #fee2e2;
|
| 18 |
+
padding: 2px 0;
|
| 19 |
+
border-radius: 2px;
|
| 20 |
+
color: #b91c1c;
|
| 21 |
+
}
|
| 22 |
+
.vulnerable-line {
|
| 23 |
+
background-color: #fee2e2;
|
| 24 |
+
display: block;
|
| 25 |
+
margin: 0 -1rem;
|
| 26 |
+
padding: 0 1rem;
|
| 27 |
+
border-left: 3px solid #dc2626;
|
| 28 |
+
}
|
| 29 |
+
.code-file-tab.active {
|
| 30 |
+
border-bottom: 2px solid #3b82f6;
|
| 31 |
+
color: #3b82f6;
|
| 32 |
+
font-weight: 500;
|
| 33 |
+
}
|
| 34 |
+
.mermaid {
|
| 35 |
+
background-color: white;
|
| 36 |
+
padding: 1rem;
|
| 37 |
+
border-radius: 0.5rem;
|
| 38 |
+
margin: 1rem 0;
|
| 39 |
+
}
|
| 40 |
+
.attack-flow {
|
| 41 |
+
counter-reset: step;
|
| 42 |
+
}
|
| 43 |
+
.attack-step {
|
| 44 |
+
position: relative;
|
| 45 |
+
padding-left: 2.5rem;
|
| 46 |
+
margin-bottom: 1rem;
|
| 47 |
+
}
|
| 48 |
+
.attack-step:before {
|
| 49 |
+
counter-increment: step;
|
| 50 |
+
content: counter(step);
|
| 51 |
+
position: absolute;
|
| 52 |
+
left: 0;
|
| 53 |
+
top: 0;
|
| 54 |
+
background-color: #3b82f6;
|
| 55 |
+
color: white;
|
| 56 |
+
width: 1.5rem;
|
| 57 |
+
height: 1.5rem;
|
| 58 |
+
border-radius: 50%;
|
| 59 |
+
display: flex;
|
| 60 |
+
align-items: center;
|
| 61 |
+
justify-content: center;
|
| 62 |
+
font-size: 0.875rem;
|
| 63 |
+
}
|
| 64 |
+
.fixed-payload {
|
| 65 |
+
background-color: #dcfce7;
|
| 66 |
+
text-decoration: line-through;
|
| 67 |
+
}
|
| 68 |
+
.risk-critical {
|
| 69 |
+
border-left: 4px solid #dc2626;
|
| 70 |
+
}
|
| 71 |
+
.risk-high {
|
| 72 |
+
border-left: 4px solid #ea580c;
|
| 73 |
+
}
|
| 74 |
+
.risk-medium {
|
| 75 |
+
border-left: 4px solid #d97706;
|
| 76 |
+
}
|
| 77 |
+
.risk-low {
|
| 78 |
+
border-left: 4px solid #65a30d;
|
| 79 |
+
}
|
| 80 |
+
.content-tab.active {
|
| 81 |
+
background-color: #3b82f6;
|
| 82 |
+
color: white;
|
| 83 |
+
}
|
| 84 |
+
</style>
|
| 85 |
+
</head>
|
| 86 |
+
<body class="bg-gray-50">
|
| 87 |
+
<div class="container mx-auto px-4 py-6">
|
| 88 |
+
<!-- Header -->
|
| 89 |
+
<div class="flex justify-between items-center mb-6">
|
| 90 |
+
<div>
|
| 91 |
+
<h1 class="text-2xl font-bold text-gray-800">风险项目详情</h1>
|
| 92 |
+
<p class="text-gray-600">AI SDL数字分身 - 安全风险分析</p>
|
| 93 |
+
</div>
|
| 94 |
+
<div class="bg-red-100 text-red-800 px-4 py-2 rounded-lg">
|
| 95 |
+
<span class="font-semibold">高风险项目</span>
|
| 96 |
+
</div>
|
| 97 |
+
</div>
|
| 98 |
+
|
| 99 |
+
<!-- Project Info -->
|
| 100 |
+
<div class="bg-white rounded-lg shadow p-6 mb-4">
|
| 101 |
+
<h2 class="text-xl font-semibold mb-4">支付宝国补项目</h2>
|
| 102 |
+
<div class="grid grid-cols-3 gap-4">
|
| 103 |
+
<div>
|
| 104 |
+
<p class="text-sm text-gray-500">项目负责人</p>
|
| 105 |
+
<p class="font-medium">张三</p>
|
| 106 |
+
</div>
|
| 107 |
+
<div>
|
| 108 |
+
<p class="text-sm text-gray-500">安全责任人</p>
|
| 109 |
+
<p class="font-medium">李四</p>
|
| 110 |
+
</div>
|
| 111 |
+
<div>
|
| 112 |
+
<p class="text-sm text-gray-500">风险发现时间</p>
|
| 113 |
+
<p class="font-medium">2023-06-15</p>
|
| 114 |
+
</div>
|
| 115 |
+
</div>
|
| 116 |
+
</div>
|
| 117 |
+
|
| 118 |
+
<!-- Risk Summary - Compact Version -->
|
| 119 |
+
<div class="bg-white rounded-lg shadow p-4 mb-6">
|
| 120 |
+
<h3 class="text-lg font-semibold mb-2">风险汇总</h3>
|
| 121 |
+
<div class="flex flex-wrap gap-2">
|
| 122 |
+
<span class="bg-red-100 text-red-800 px-3 py-1 rounded-full text-sm">需求: 越权访问</span>
|
| 123 |
+
<span class="bg-red-100 text-red-800 px-3 py-1 rounded-full text-sm">代码: SQL注入</span>
|
| 124 |
+
<span class="bg-orange-100 text-orange-800 px-3 py-1 rounded-full text-sm">测试: ID枚举</span>
|
| 125 |
+
<span class="bg-yellow-100 text-yellow-800 px-3 py-1 rounded-full text-sm">发布: 1未修复</span>
|
| 126 |
+
</div>
|
| 127 |
+
</div>
|
| 128 |
+
|
| 129 |
+
<!-- Tabs -->
|
| 130 |
+
<div class="flex border-b mb-6">
|
| 131 |
+
<button class="tab-btn px-4 py-2 font-medium text-blue-600 border-b-2 border-blue-600" data-tab="requirements">需求分析</button>
|
| 132 |
+
<button class="tab-btn px-4 py-2 font-medium text-gray-600 hover:text-blue-600" data-tab="code">代码分析</button>
|
| 133 |
+
<button class="tab-btn px-4 py-2 font-medium text-gray-600 hover:text-blue-600" data-tab="testing">安全测试</button>
|
| 134 |
+
<button class="tab-btn px-4 py-2 font-medium text-gray-600 hover:text-blue-600" data-tab="release">发布检查</button>
|
| 135 |
+
<button class="tab-btn px-4 py-2 font-medium text-gray-600 hover:text-blue-600" data-tab="production">线上监控</button>
|
| 136 |
+
</div>
|
| 137 |
+
|
| 138 |
+
<!-- Tab Contents -->
|
| 139 |
+
<div class="bg-white rounded-lg shadow overflow-hidden">
|
| 140 |
+
<!-- Requirements Tab -->
|
| 141 |
+
<div id="requirements" class="tab-content">
|
| 142 |
+
<div class="grid grid-cols-2 divide-x">
|
| 143 |
+
<!-- Left: Content -->
|
| 144 |
+
<div class="p-6">
|
| 145 |
+
<div class="flex mb-4">
|
| 146 |
+
<button class="content-tab active px-4 py-2 rounded-l" data-content="doc">需求文档</button>
|
| 147 |
+
<button class="content-tab px-4 py-2 rounded-r" data-content="diagram">技术架构图</button>
|
| 148 |
+
</div>
|
| 149 |
+
|
| 150 |
+
<div id="doc-content" class="content-container">
|
| 151 |
+
<p>支付宝国补项目需求文档 v1.2</p>
|
| 152 |
+
<p class="mt-4">1. 项目背景:为响应国家补贴政策,支付宝平台新增国补专区,为用户提供补贴申请、查询等服务。</p>
|
| 153 |
+
<p class="mt-2">2. 功能需求:</p>
|
| 154 |
+
<p class="mt-2 ml-4">2.1 用户认证:用户需完成实名认证方可申请补贴</p>
|
| 155 |
+
<p class="mt-2 ml-4">2.2 补贴申请:用户填写申请表,提交后进入审核流程</p>
|
| 156 |
+
<p class="mt-2 ml-4">2.3 补贴查询:用户可查询历史补贴记录及当前申请状态</p>
|
| 157 |
+
<p class="mt-2 ml-4 risk-highlight" id="req-1">2.4 管理员功能:管理员可查看所有用户补贴申请,并有权修改申请状态</p>
|
| 158 |
+
<p class="mt-2 risk-highlight" id="req-2">3. 技术实现:采用微服务架构,补贴服务独立部署,通过API网关暴露接口</p>
|
| 159 |
+
<p class="mt-2">4. 数据存储:用户补贴数据存储在MySQL数据库,补贴申请表单独存储</p>
|
| 160 |
+
<p class="mt-2 risk-highlight" id="req-3">5. 权限控制:前端根据用户角色显示不同功能,后端接口需验证用户权限</p>
|
| 161 |
+
</div>
|
| 162 |
+
|
| 163 |
+
<div id="diagram-content" class="content-container hidden">
|
| 164 |
+
<div class="mermaid">
|
| 165 |
+
graph TD
|
| 166 |
+
A[用户端] --> B[API网关]
|
| 167 |
+
B --> C[认证服务]
|
| 168 |
+
B --> D[补贴服务]
|
| 169 |
+
D --> E[(MySQL)]
|
| 170 |
+
D --> F[(Redis)]
|
| 171 |
+
C --> E
|
| 172 |
+
G[管理后台] --> B
|
| 173 |
+
H[风控系统] --> D
|
| 174 |
+
</div>
|
| 175 |
+
</div>
|
| 176 |
+
</div>
|
| 177 |
+
|
| 178 |
+
<!-- Right: Analysis -->
|
| 179 |
+
<div class="p-6">
|
| 180 |
+
<h3 class="text-lg font-semibold mb-4">安全分析结果</h3>
|
| 181 |
+
<div class="content-container">
|
| 182 |
+
<h4 class="font-medium text-red-600 mb-2">STRIDE威胁建模</h4>
|
| 183 |
+
<div class="mermaid">
|
| 184 |
+
graph LR
|
| 185 |
+
A[管理员功能] -->|Spoofing| B[未强制二次认证]
|
| 186 |
+
A -->|Tampering| C[状态修改无审批流]
|
| 187 |
+
A -->|Repudiation| D[操作日志不完整]
|
| 188 |
+
E[补贴查询] -->|Information Disclosure| F[返回过多用户信息]
|
| 189 |
+
G[API网关] -->|Denial of Service| H[无速率限制]
|
| 190 |
+
</div>
|
| 191 |
+
|
| 192 |
+
<h4 class="font-medium mt-6 mb-2">安全风险分析</h4>
|
| 193 |
+
<div class="space-y-4">
|
| 194 |
+
<div class="border rounded-lg p-4 risk-critical" onclick="scrollToRequirement('req-1')" style="cursor: pointer;">
|
| 195 |
+
<p class="font-medium">业务场景: 管理员修改补贴申请状态</p>
|
| 196 |
+
<p class="text-sm text-gray-600 mt-1">风险点: 后端接口未验证管理员权限</p>
|
| 197 |
+
<p class="text-sm text-gray-600 mt-1">风险类型: 越权访问</p>
|
| 198 |
+
<p class="text-sm text-blue-600 mt-1">整改建议: 1. 接口添加权限校验 2. 记录操作日志 3. 添加二次确认</p>
|
| 199 |
+
</div>
|
| 200 |
+
<div class="border rounded-lg p-4 risk-high" onclick="scrollToRequirement('req-2')" style="cursor: pointer;">
|
| 201 |
+
<p class="font-medium">业务场景: 补贴查询接口</p>
|
| 202 |
+
<p class="text-sm text-gray-600 mt-1">风险点: 返回所有用户字段</p>
|
| 203 |
+
<p class="text-sm text-gray-600 mt-1">风险类型: 信息泄露</p>
|
| 204 |
+
<p class="text-sm text-blue-600 mt-1">整改建议: 1. 只返回必要字段 2. 添加数据脱敏</p>
|
| 205 |
+
</div>
|
| 206 |
+
<div class="border rounded-lg p-4 risk-medium" onclick="scrollToRequirement('req-3')" style="cursor: pointer;">
|
| 207 |
+
<p class="font-medium">业务场景: 权限控制设计</p>
|
| 208 |
+
<p class="text-sm text-gray-600 mt-1">风险点: 仅前端控制权限</p>
|
| 209 |
+
<p class="text-sm text-gray-600 mt-1">风险类型: 权限绕过</p>
|
| 210 |
+
<p class="text-sm text-blue-600 mt-1">整改建议: 1. 后端添加权限校验 2. 实现RBAC模型</p>
|
| 211 |
+
</div>
|
| 212 |
+
</div>
|
| 213 |
+
</div>
|
| 214 |
+
</div>
|
| 215 |
+
</div>
|
| 216 |
+
</div>
|
| 217 |
+
|
| 218 |
+
<!-- Code Tab -->
|
| 219 |
+
<div id="code" class="tab-content hidden">
|
| 220 |
+
<div class="grid grid-cols-2 divide-x">
|
| 221 |
+
<!-- Left: Content -->
|
| 222 |
+
<div class="p-6">
|
| 223 |
+
<h3 class="text-lg font-semibold mb-4">代码内容</h3>
|
| 224 |
+
<div class="flex border-b mb-4">
|
| 225 |
+
<button class="code-file-tab px-4 py-2 active" data-file="subsidyService.js">subsidyService.js</button>
|
| 226 |
+
<button class="code-file-tab px-4 py-2" data-file="authMiddleware.js">authMiddleware.js</button>
|
| 227 |
+
<button class="code-file-tab px-4 py-2" data-file="subsidyController.js">subsidyController.js</button>
|
| 228 |
+
</div>
|
| 229 |
+
<div class="content-container">
|
| 230 |
+
<div id="subsidyService.js" class="code-content">
|
| 231 |
+
<pre><code class="language-javascript">const db = require('./db');
|
| 232 |
+
|
| 233 |
+
// 获取用户补贴信息
|
| 234 |
+
async function getUserSubsidy(userId) {
|
| 235 |
+
const query = `SELECT * FROM subsidies WHERE user_id = '${userId}'`;
|
| 236 |
+
return await db.query(query);
|
| 237 |
+
}
|
| 238 |
+
|
| 239 |
+
// 更新补贴状态
|
| 240 |
+
async function updateSubsidyStatus(subsidyId, status) {
|
| 241 |
+
// 漏洞: 未验证管理员权限
|
| 242 |
+
const query = `UPDATE subsidies SET status = '${status}' WHERE id = ${subsidyId}`;
|
| 243 |
+
return await db.query(query);
|
| 244 |
+
}
|
| 245 |
+
|
| 246 |
+
// 获取所有补贴申请 (管理员)
|
| 247 |
+
async function getAllSubsidies() {
|
| 248 |
+
const query = `SELECT * FROM subsidies`;
|
| 249 |
+
return await db.query(query);
|
| 250 |
+
}
|
| 251 |
+
|
| 252 |
+
module.exports = {
|
| 253 |
+
getUserSubsidy,
|
| 254 |
+
updateSubsidyStatus,
|
| 255 |
+
getAllSubsidies
|
| 256 |
+
};</code></pre>
|
| 257 |
+
</div>
|
| 258 |
+
<div id="authMiddleware.js" class="code-content hidden">
|
| 259 |
+
<pre><code class="language-javascript">// 认证中间件
|
| 260 |
+
function authenticate(req, res, next) {
|
| 261 |
+
const token = req.headers['authorization'];
|
| 262 |
+
if (!token) {
|
| 263 |
+
return res.status(401).json({ error: '未授权' });
|
| 264 |
+
}
|
| 265 |
+
|
| 266 |
+
// 验证token逻辑...
|
| 267 |
+
next();
|
| 268 |
+
}
|
| 269 |
+
|
| 270 |
+
module.exports = {
|
| 271 |
+
authenticate
|
| 272 |
+
};</code></pre>
|
| 273 |
+
</div>
|
| 274 |
+
<div id="subsidyController.js" class="code-content hidden">
|
| 275 |
+
<pre><code class="language-javascript">const express = require('express');
|
| 276 |
+
const router = express.Router();
|
| 277 |
+
const subsidyService = require('./subsidyService');
|
| 278 |
+
|
| 279 |
+
// 获取用户补贴信息
|
| 280 |
+
router.get('/:userId', async (req, res) => {
|
| 281 |
+
try {
|
| 282 |
+
const subsidies = await subsidyService.getUserSubsidy(req.params.userId);
|
| 283 |
+
res.json(subsidies);
|
| 284 |
+
} catch (error) {
|
| 285 |
+
res.status(500).json({ error: error.message });
|
| 286 |
+
}
|
| 287 |
+
});
|
| 288 |
+
|
| 289 |
+
// 更新补贴状态
|
| 290 |
+
router.put('/status/:subsidyId', async (req, res) => {
|
| 291 |
+
try {
|
| 292 |
+
const result = await subsidyService.updateSubsidyStatus(
|
| 293 |
+
req.params.subsidyId,
|
| 294 |
+
req.body.status
|
| 295 |
+
);
|
| 296 |
+
res.json(result);
|
| 297 |
+
} catch (error) {
|
| 298 |
+
res.status(500).json({ error: error.message });
|
| 299 |
+
}
|
| 300 |
+
});
|
| 301 |
+
|
| 302 |
+
module.exports = router;</code></pre>
|
| 303 |
+
</div>
|
| 304 |
+
</div>
|
| 305 |
+
</div>
|
| 306 |
+
|
| 307 |
+
<!-- Right: Analysis -->
|
| 308 |
+
<div class="p-6">
|
| 309 |
+
<h3 class="text-lg font-semibold mb-4">安全分析结果</h3>
|
| 310 |
+
<div class="content-container">
|
| 311 |
+
<div class="space-y-4">
|
| 312 |
+
<div class="border rounded-lg p-4 risk-critical">
|
| 313 |
+
<p class="font-medium">漏洞名称: SQL注入</p>
|
| 314 |
+
<p class="text-sm text-gray-600 mt-1">风险接口: GET /subsidies/:userId</p>
|
| 315 |
+
<p class="text-sm text-gray-600 mt-1">漏洞类型: 注入漏洞</p>
|
| 316 |
+
<p class="text-sm text-gray-600 mt-1">漏洞级别: 高危</p>
|
| 317 |
+
<p class="text-sm text-gray-600 mt-1">漏洞描述: 用户ID直接拼接到SQL查询中,可能导致SQL注入攻击</p>
|
| 318 |
+
<div class="mt-2">
|
| 319 |
+
<p class="text-sm font-medium">修复代码:</p>
|
| 320 |
+
<pre><code class="language-javascript text-sm">// 修复后代码
|
| 321 |
+
async function getUserSubsidy(userId) {
|
| 322 |
+
const query = 'SELECT * FROM subsidies WHERE user_id = ?';
|
| 323 |
+
return await db.query(query, [userId]);
|
| 324 |
+
}</code></pre>
|
| 325 |
+
</div>
|
| 326 |
+
<button class="mt-2 text-sm text-blue-600 hover:underline" onclick="highlightCodeLine('subsidyService.js', 4)">定位漏洞代码</button>
|
| 327 |
+
</div>
|
| 328 |
+
<div class="border rounded-lg p-4 risk-critical">
|
| 329 |
+
<p class="font-medium">漏洞名称: 越权访问</p>
|
| 330 |
+
<p class="text-sm text-gray-600 mt-1">风险接口: PUT /status/:subsidyId</p>
|
| 331 |
+
<p class="text-sm text-gray-600 mt-1">漏洞类型: 权限漏洞</p>
|
| 332 |
+
<p class="text-sm text-gray-600 mt-1">漏洞级别: 高危</p>
|
| 333 |
+
<p class="text-sm text-gray-600 mt-1">漏洞描述: 接口未验证调用者是否有权限修改补贴状态</p>
|
| 334 |
+
<div class="mt-2">
|
| 335 |
+
<p class="text-sm font-medium">修复代码:</p>
|
| 336 |
+
<pre><code class="language-javascript text-sm">// 修复后代码
|
| 337 |
+
async function updateSubsidyStatus(userId, subsidyId, status) {
|
| 338 |
+
// 首先验证用户是否有权限修改这个补贴
|
| 339 |
+
const canUpdate = await checkPermission(userId, subsidyId);
|
| 340 |
+
if (!canUpdate) {
|
| 341 |
+
throw new Error('无权修改此补贴状态');
|
| 342 |
+
}
|
| 343 |
+
|
| 344 |
+
const query = 'UPDATE subsidies SET status = ? WHERE id = ?';
|
| 345 |
+
return await db.query(query, [status, subsidyId]);
|
| 346 |
+
}</code></pre>
|
| 347 |
+
</div>
|
| 348 |
+
<button class="mt-2 text-sm text-blue-600 hover:underline" onclick="highlightCodeLine('subsidyService.js', 9)">定位漏洞代码</button>
|
| 349 |
+
</div>
|
| 350 |
+
<div class="border rounded-lg p-4 risk-high">
|
| 351 |
+
<p class="font-medium">漏洞名称: 信息泄露</p>
|
| 352 |
+
<p class="text-sm text-gray-600 mt-1">风险接口: GET /subsidies/:userId</p>
|
| 353 |
+
<p class="text-sm text-gray-600 mt-1">漏洞类型: 数据泄露</p>
|
| 354 |
+
<p class="text-sm text-gray-600 mt-1">漏洞级别: 高危</p>
|
| 355 |
+
<p class="text-sm text-gray-600 mt-1">漏洞描述: 返回所有用户补贴信息字段,包含敏感数据</p>
|
| 356 |
+
<div class="mt-2">
|
| 357 |
+
<p class="text-sm font-medium">修复代码:</p>
|
| 358 |
+
<pre><code class="language-javascript text-sm">// 修复后代码
|
| 359 |
+
async function getUserSubsidy(userId) {
|
| 360 |
+
const query = 'SELECT id, amount, status FROM subsidies WHERE user_id = ?';
|
| 361 |
+
return await db.query(query, [userId]);
|
| 362 |
+
}</code></pre>
|
| 363 |
+
</div>
|
| 364 |
+
<button class="mt-2 text-sm text-blue-600 hover:underline" onclick="highlightCodeLine('subsidyService.js', 4)">定位漏洞代码</button>
|
| 365 |
+
</div>
|
| 366 |
+
</div>
|
| 367 |
+
</div>
|
| 368 |
+
</div>
|
| 369 |
+
</div>
|
| 370 |
+
</div>
|
| 371 |
+
|
| 372 |
+
<!-- Testing Tab -->
|
| 373 |
+
<div id="testing" class="tab-content hidden">
|
| 374 |
+
<div class="grid grid-cols-2 divide-x">
|
| 375 |
+
<!-- Left: Content -->
|
| 376 |
+
<div class="p-6">
|
| 377 |
+
<h3 class="text-lg font-semibold mb-4">测试内容</h3>
|
| 378 |
+
<div class="content-container">
|
| 379 |
+
<h4 class="font-medium mb-2">风险接口: /api/subsidies/1001</h4>
|
| 380 |
+
<div class="bg-gray-100 p-4 rounded-lg mb-4">
|
| 381 |
+
<p class="font-medium">攻击Payload:</p>
|
| 382 |
+
<pre><code class="language-http">GET /api/subsidies/1001%27%20OR%201%3D1-- HTTP/1.1
|
| 383 |
+
Host: example.com
|
| 384 |
+
Authorization: Bearer user_token</code></pre>
|
| 385 |
+
</div>
|
| 386 |
+
|
| 387 |
+
<h4 class="font-medium mb-2 mt-6">风险接口: /api/subsidies/status/1001</h4>
|
| 388 |
+
<div class="bg-gray-100 p-4 rounded-lg">
|
| 389 |
+
<p class="font-medium">攻击Payload:</p>
|
| 390 |
+
<pre><code class="language-http">PUT /api/subsidies/status/1002 HTTP/1.1
|
| 391 |
+
Host: example.com
|
| 392 |
+
Authorization: Bearer user_token
|
| 393 |
+
Content-Type: application/json
|
| 394 |
+
|
| 395 |
+
{
|
| 396 |
+
"status": "approved"
|
| 397 |
+
}</code></pre>
|
| 398 |
+
</div>
|
| 399 |
+
|
| 400 |
+
<div class="mt-6 p-4 bg-green-50 rounded-lg">
|
| 401 |
+
<p class="font-medium">攻击结果:</p>
|
| 402 |
+
<pre><code class="language-json">{
|
| 403 |
+
"id": 1002,
|
| 404 |
+
"user_id": "other_user",
|
| 405 |
+
"amount": 5000,
|
| 406 |
+
"status": "approved",
|
| 407 |
+
"created_at": "2023-06-01T10:00:00Z"
|
| 408 |
+
}</code></pre>
|
| 409 |
+
<p class="text-red-600 mt-2">攻击成功: 普通用户成功修改了其他用户的补贴状态</p>
|
| 410 |
+
</div>
|
| 411 |
+
</div>
|
| 412 |
+
</div>
|
| 413 |
+
|
| 414 |
+
<!-- Right: Analysis -->
|
| 415 |
+
<div class="p-6">
|
| 416 |
+
<h3 class="text-lg font-semibold mb-4">安全分析结果</h3>
|
| 417 |
+
<div class="content-container">
|
| 418 |
+
<div class="space-y-4">
|
| 419 |
+
<div class="border rounded-lg p-4">
|
| 420 |
+
<p class="font-medium">风险接口地址: /api/subsidies/{userId}</p>
|
| 421 |
+
<p class="text-sm text-gray-600 mt-1">风险描述: SQL注入漏洞导致可以获取所有用户补贴信息</p>
|
| 422 |
+
|
| 423 |
+
<h4 class="font-medium mt-4 mb-2">攻击手法:</h4>
|
| 424 |
+
<div class="attack-flow">
|
| 425 |
+
<div class="attack-step">攻击者登录自己的账号,获取一个合法的用户ID</div>
|
| 426 |
+
<div class="attack-step">构造恶意SQL注入Payload替换用户ID</div>
|
| 427 |
+
<div class="attack-step">服务器执行恶意SQL查询,返回所有用户数据</div>
|
| 428 |
+
<div class="attack-step">攻击者获取大量敏感用户补贴信息</div>
|
| 429 |
+
</div>
|
| 430 |
+
</div>
|
| 431 |
+
|
| 432 |
+
<div class="border rounded-lg p-4">
|
| 433 |
+
<p class="font-medium">风险接口地址: /api/subsidies/status/{subsidyId}</p>
|
| 434 |
+
<p class="text-sm text-gray-600 mt-1">风险描述: 越权修改其他用户补贴状态</p>
|
| 435 |
+
|
| 436 |
+
<h4 class="font-medium mt-4 mb-2">攻击手法:</h4>
|
| 437 |
+
<div class="attack-flow">
|
| 438 |
+
<div class="attack-step">攻击者登录自己的账号,获取一个合法的订单ID</div>
|
| 439 |
+
<div class="attack-step">修改请求中的subsidyId参数,尝试访问其他订单ID</div>
|
| 440 |
+
<div class="attack-step">服务器未进行权限校验,成功修改状态</div>
|
| 441 |
+
<div class="attack-step">通过自动化工具可以批量修改大量订单状态</div>
|
| 442 |
+
</div>
|
| 443 |
+
</div>
|
| 444 |
+
|
| 445 |
+
<div class="mt-6 p-4 bg-blue-50 rounded-lg">
|
| 446 |
+
<h4 class="font-medium mb-2">修复建议:</h4>
|
| 447 |
+
<div class="flex items-start">
|
| 448 |
+
<div class="flex-1">
|
| 449 |
+
<pre><code class="language-http fixed-payload">GET /api/subsidies/1001 HTTP/1.1</code></pre>
|
| 450 |
+
<p class="text-sm mt-1">使用参数化查询:</p>
|
| 451 |
+
<pre><code class="language-javascript">const query = 'SELECT * FROM subsidies WHERE user_id = ?';
|
| 452 |
+
db.query(query, [userId]);</code></pre>
|
| 453 |
+
</div>
|
| 454 |
+
<button class="ml-4 px-3 py-1 bg-green-100 text-green-800 rounded text-sm">已修复</button>
|
| 455 |
+
</div>
|
| 456 |
+
</div>
|
| 457 |
+
</div>
|
| 458 |
+
</div>
|
| 459 |
+
</div>
|
| 460 |
+
</div>
|
| 461 |
+
</div>
|
| 462 |
+
|
| 463 |
+
<!-- Release Tab -->
|
| 464 |
+
<div id="release" class="tab-content hidden">
|
| 465 |
+
<div class="grid grid-cols-2 divide-x">
|
| 466 |
+
<!-- Left: Content -->
|
| 467 |
+
<div class="p-6">
|
| 468 |
+
<h3 class="text-lg font-semibold mb-4">发布检查内容</h3>
|
| 469 |
+
<div class="content-container">
|
| 470 |
+
<div class="space-y-4">
|
| 471 |
+
<div class="border rounded-lg p-4">
|
| 472 |
+
<h4 class="font-medium">需求环节遗留风险</h4>
|
| 473 |
+
<p class="text-sm text-gray-600 mt-1">管理员越权风险: 已添加权限校验中间件</p>
|
| 474 |
+
<p class="text-sm text-green-600 mt-1">状态: 已修复</p>
|
| 475 |
+
</div>
|
| 476 |
+
|
| 477 |
+
<div class="border rounded-lg p-4">
|
| 478 |
+
<h4 class="font-medium">代码环节遗留风险</h4>
|
| 479 |
+
<p class="text-sm text-gray-600 mt-1">SQL注入漏洞: 已改为参数化查询</p>
|
| 480 |
+
<p class="text-sm text-green-600 mt-1">状态: 已修复</p>
|
| 481 |
+
<p class="text-sm text-gray-600 mt-1">信息泄露风险: 已添加数据脱敏</p>
|
| 482 |
+
<p class="text-sm text-green-600 mt-1">状态: 已修复</p>
|
| 483 |
+
</div>
|
| 484 |
+
|
| 485 |
+
<div class="border rounded-lg p-4 bg-red-50">
|
| 486 |
+
<h4 class="font-medium text-red-600">安全测试环节遗留风险</h4>
|
| 487 |
+
<p class="text-sm text-gray-600 mt-1">订单ID枚举漏洞: 未完全修复</p>
|
| 488 |
+
<p class="text-sm text-red-600 mt-1">状态: 未修复</p>
|
| 489 |
+
<p class="text-sm text-blue-600 mt-1">建议: 添加速率限制和异常检测</p>
|
| 490 |
+
</div>
|
| 491 |
+
</div>
|
| 492 |
+
</div>
|
| 493 |
+
</div>
|
| 494 |
+
|
| 495 |
+
<!-- Right: Analysis -->
|
| 496 |
+
<div class="p-6">
|
| 497 |
+
<h3 class="text-lg font-semibold mb-4">安全分析结果</h3>
|
| 498 |
+
<div class="content-container">
|
| 499 |
+
<div class="space-y-4">
|
| 500 |
+
<div class="border rounded-lg p-4 bg-green-50">
|
| 501 |
+
<h4 class="font-medium text-green-800">已修复风险</h4>
|
| 502 |
+
<ul class="list-disc pl-5 mt-2 text-sm text-gray-700">
|
| 503 |
+
<li>需求环节: 管理员越权风险</li>
|
| 504 |
+
<li>代码环节: SQL注入漏洞</li>
|
| 505 |
+
<li>代码环节: 信息泄露风险</li>
|
| 506 |
+
</ul>
|
| 507 |
+
</div>
|
| 508 |
+
|
| 509 |
+
<div class="border rounded-lg p-4 bg-red-50">
|
| 510 |
+
<h4 class="font-medium text-red-800">未修复风险</h4>
|
| 511 |
+
<div class="mt-2">
|
| 512 |
+
<p class="font-medium">订单ID枚举漏洞</p>
|
| 513 |
+
<p class="text-sm text-gray-600 mt-1">风险描述: 攻击者可以通过枚举ID获取其他用户信息</p>
|
| 514 |
+
<p class="text-sm text-blue-600 mt-1">影响环节: 安全测试环节发现,代码环节未完全修复</p>
|
| 515 |
+
<p class="text-sm text-blue-600 mt-1">建议措施: 1. 添加速率限制 2. 实现资源级权限控制 3. 监控异常访问</p>
|
| 516 |
+
</div>
|
| 517 |
+
</div>
|
| 518 |
+
|
| 519 |
+
<div class="mt-6 p-4 bg-blue-50 rounded-lg">
|
| 520 |
+
<h4 class="font-medium mb-2">发布决策</h4>
|
| 521 |
+
<div class="flex items-center">
|
| 522 |
+
<div class="flex-1">
|
| 523 |
+
<p class="text-sm">存在1个未修复的高危漏洞,建议:</p>
|
| 524 |
+
<p class="font-medium text-red-600">延迟发布,优先修复订单ID枚举漏洞</p>
|
| 525 |
+
</div>
|
| 526 |
+
<button class="ml-4 px-4 py-2 bg-red-100 text-red-800 rounded">拒绝发布</button>
|
| 527 |
+
</div>
|
| 528 |
+
</div>
|
| 529 |
+
</div>
|
| 530 |
+
</div>
|
| 531 |
+
</div>
|
| 532 |
+
</div>
|
| 533 |
+
</div>
|
| 534 |
+
|
| 535 |
+
<!-- Production Tab -->
|
| 536 |
+
<div id="production" class="tab-content hidden">
|
| 537 |
+
<div class="grid grid-cols-2 divide-x">
|
| 538 |
+
<!-- Left: Content -->
|
| 539 |
+
<div class="p-6">
|
| 540 |
+
<h3 class="text-lg font-semibold mb-4">线上监控内容</h3>
|
| 541 |
+
<div class="content-container">
|
| 542 |
+
<div class="space-y-4">
|
| 543 |
+
<div class="border rounded-lg p-4 bg-red-50">
|
| 544 |
+
<h4 class="font-medium text-red-800">安全事件</h4>
|
| 545 |
+
<p class="text-sm mt-1">2023-06-20 14:30: 检测到异常补贴状态修改请求</p>
|
| 546 |
+
<p class="text-sm mt-1">2023-06-21 09:15: 检测到批量补贴查询请求</p>
|
| 547 |
+
</div>
|
| 548 |
+
|
| 549 |
+
<div class="border rounded-lg p-4">
|
| 550 |
+
<h4 class="font-medium">监控指标</h4>
|
| 551 |
+
<div class="grid grid-cols-2 gap-4 mt-2">
|
| 552 |
+
<div>
|
| 553 |
+
<p class="text-sm text-gray-600">异常请求数</p>
|
| 554 |
+
<p class="text-xl font-bold">128</p>
|
| 555 |
+
</div>
|
| 556 |
+
<div>
|
| 557 |
+
<p class="text-sm text-gray-600">拦截攻击</p>
|
| 558 |
+
<p class="text-xl font-bold">42</p>
|
| 559 |
+
</div>
|
| 560 |
+
</div>
|
| 561 |
+
</div>
|
| 562 |
+
|
| 563 |
+
<div class="border rounded-lg p-4">
|
| 564 |
+
<h4 class="font-medium">访问日志</h4>
|
| 565 |
+
<div class="mt-2 overflow-x-auto">
|
| 566 |
+
<table class="min-w-full text-sm">
|
| 567 |
+
<thead>
|
| 568 |
+
<tr class="border-b">
|
| 569 |
+
<th class="py-2 text-left">时间</th>
|
| 570 |
+
<th class="py-2 text-left">接口</th>
|
| 571 |
+
<th class="py-2 text-left">状态</th>
|
| 572 |
+
</tr>
|
| 573 |
+
</thead>
|
| 574 |
+
<tbody>
|
| 575 |
+
<tr class="border-b">
|
| 576 |
+
<td class="py-2">2023-06-20 14:30:22</td>
|
| 577 |
+
<td class="py-2">PUT /status/1002</td>
|
| 578 |
+
<td class="py-2 text-red-600">拦截</td>
|
| 579 |
+
</tr>
|
| 580 |
+
<tr class="border-b">
|
| 581 |
+
<td class="py-2">2023-06-20 14:30:25</td>
|
| 582 |
+
<td class="py-2">PUT /status/1003</td>
|
| 583 |
+
<td class="py-2 text-red-600">拦截</td>
|
| 584 |
+
</tr>
|
| 585 |
+
<tr>
|
| 586 |
+
<td class="py-2">2023-06-20 14:30:28</td>
|
| 587 |
+
<td class="py-2">PUT /status/1004</td>
|
| 588 |
+
<td class="py-2 text-red-600">拦截</td>
|
| 589 |
+
</tr>
|
| 590 |
+
</tbody>
|
| 591 |
+
</table>
|
| 592 |
+
</div>
|
| 593 |
+
</div>
|
| 594 |
+
</div>
|
| 595 |
+
</div>
|
| 596 |
+
</div>
|
| 597 |
+
|
| 598 |
+
<!-- Right: Analysis -->
|
| 599 |
+
<div class="p-6">
|
| 600 |
+
<h3 class="text-lg font-semibold mb-4">安全分析结果</h3>
|
| 601 |
+
<div class="content-container">
|
| 602 |
+
<div class="space-y-4">
|
| 603 |
+
<div class="border rounded-lg p-4">
|
| 604 |
+
<h4 class="font-medium">漏洞修复情况</h4>
|
| 605 |
+
<div class="mt-2">
|
| 606 |
+
<p class="text-sm font-medium">SQL注入漏洞</p>
|
| 607 |
+
<p class="text-sm text-green-600">已修复 - 2023-06-18</p>
|
| 608 |
+
<p class="text-sm text-gray-600 mt-1">修复后未发现相关攻击</p>
|
| 609 |
+
</div>
|
| 610 |
+
<div class="mt-4">
|
| 611 |
+
<p class="text-sm font-medium">越权访问漏洞</p>
|
| 612 |
+
<p class="text-sm text-green-600">已修复 - 2023-06-19</p>
|
| 613 |
+
<p class="text-sm text-gray-600 mt-1">修复后拦截42次攻击尝试</p>
|
| 614 |
+
</div>
|
| 615 |
+
</div>
|
| 616 |
+
|
| 617 |
+
<div class="border rounded-lg p-4 bg-yellow-50">
|
| 618 |
+
<h4 class="font-medium text-yellow-800">待处理问题</h4>
|
| 619 |
+
<div class="mt-2">
|
| 620 |
+
<p class="text-sm font-medium">订单ID枚举漏洞</p>
|
| 621 |
+
<p class="text-sm text-red-600">未完全修复</p>
|
| 622 |
+
<p class="text-sm text-gray-600 mt-1">检测到128次枚举尝试</p>
|
| 623 |
+
<p class="text-sm text-blue-600 mt-1">建议: 添加资源级权限控制</p>
|
| 624 |
+
</div>
|
| 625 |
+
</div>
|
| 626 |
+
|
| 627 |
+
<div class="border rounded-lg p-4">
|
| 628 |
+
<h4 class="font-medium">安全态势</h4>
|
| 629 |
+
<div class="mt-2">
|
| 630 |
+
<div class="flex items-center justify-between mb-1">
|
| 631 |
+
<span class="text-sm">SQL注入防护</span>
|
| 632 |
+
<span class="text-sm font-medium text-green-600">有效</span>
|
| 633 |
+
</div>
|
| 634 |
+
<div class="w-full bg-gray-200 rounded-full h-2.5">
|
| 635 |
+
<div class="bg-green-600 h-2.5 rounded-full" style="width: 100%"></div>
|
| 636 |
+
</div>
|
| 637 |
+
</div>
|
| 638 |
+
<div class="mt-4">
|
| 639 |
+
<div class="flex items-center justify-between mb-1">
|
| 640 |
+
<span class="text-sm">越权访问防护</span>
|
| 641 |
+
<span class="text-sm font-medium text-green-600">有效</span>
|
| 642 |
+
</div>
|
| 643 |
+
<div class="w-full bg-gray-200 rounded-full h-2.5">
|
| 644 |
+
<div class="bg-green-600 h-2.5 rounded-full" style="width: 95%"></div>
|
| 645 |
+
</div>
|
| 646 |
+
</div>
|
| 647 |
+
<div class="mt-4">
|
| 648 |
+
<div class="flex items-center justify-between mb-1">
|
| 649 |
+
<span class="text-sm">枚举攻击防护</span>
|
| 650 |
+
<span class="text-sm font-medium text-yellow-600">部分有效</span>
|
| 651 |
+
</div>
|
| 652 |
+
<div class="w-full bg-gray-200 rounded-full h-2.5">
|
| 653 |
+
<div class="bg-yellow-400 h-2.5 rounded-full" style="width: 60%"></div>
|
| 654 |
+
</div>
|
| 655 |
+
</div>
|
| 656 |
+
</div>
|
| 657 |
+
</div>
|
| 658 |
+
</div>
|
| 659 |
+
</div>
|
| 660 |
+
</div>
|
| 661 |
+
</div>
|
| 662 |
+
</div>
|
| 663 |
+
</div>
|
| 664 |
+
|
| 665 |
+
<script>
|
| 666 |
+
// Initialize Mermaid
|
| 667 |
+
mermaid.initialize({
|
| 668 |
+
startOnLoad: true,
|
| 669 |
+
theme: 'default',
|
| 670 |
+
flowchart: { useMaxWidth: false }
|
| 671 |
+
});
|
| 672 |
+
|
| 673 |
+
// Initialize syntax highlighting
|
| 674 |
+
document.addEventListener('DOMContentLoaded', (event) => {
|
| 675 |
+
document.querySelectorAll('pre code').forEach((block) => {
|
| 676 |
+
hljs.highlightElement(block);
|
| 677 |
+
});
|
| 678 |
+
});
|
| 679 |
+
|
| 680 |
+
// Tab switching
|
| 681 |
+
document.querySelectorAll('.tab-btn').forEach(btn => {
|
| 682 |
+
btn.addEventListener('click', () => {
|
| 683 |
+
// Update tab buttons
|
| 684 |
+
document.querySelectorAll('.tab-btn').forEach(b => {
|
| 685 |
+
b.classList.remove('text-blue-600', 'border-blue-600');
|
| 686 |
+
b.classList.add('text-gray-600', 'hover:text-blue-600');
|
| 687 |
+
});
|
| 688 |
+
btn.classList.add('text-blue-600', 'border-blue-600');
|
| 689 |
+
btn.classList.remove('text-gray-600', 'hover:text-blue-600');
|
| 690 |
+
|
| 691 |
+
// Show selected tab content
|
| 692 |
+
const tabId = btn.getAttribute('data-tab');
|
| 693 |
+
document.querySelectorAll('.tab-content').forEach(content => {
|
| 694 |
+
content.classList.add('hidden');
|
| 695 |
+
});
|
| 696 |
+
document.getElementById(tabId).classList.remove('hidden');
|
| 697 |
+
});
|
| 698 |
+
});
|
| 699 |
+
|
| 700 |
+
// Code file tabs
|
| 701 |
+
document.querySelectorAll('.code-file-tab').forEach(tab => {
|
| 702 |
+
tab.addEventListener('click', () => {
|
| 703 |
+
// Update tab buttons
|
| 704 |
+
document.querySelectorAll('.code-file-tab').forEach(t => {
|
| 705 |
+
t.classList.remove('active');
|
| 706 |
+
});
|
| 707 |
+
tab.classList.add('active');
|
| 708 |
+
|
| 709 |
+
// Show selected file content
|
| 710 |
+
const fileId = tab.getAttribute('data-file');
|
| 711 |
+
document.querySelectorAll('.code-content').forEach(content => {
|
| 712 |
+
content.classList.add('hidden');
|
| 713 |
+
});
|
| 714 |
+
document.getElementById(fileId).classList.remove('hidden');
|
| 715 |
+
});
|
| 716 |
+
});
|
| 717 |
+
|
| 718 |
+
// Content tabs in requirements section
|
| 719 |
+
document.querySelectorAll('.content-tab').forEach(tab => {
|
| 720 |
+
tab.addEventListener('click', () => {
|
| 721 |
+
// Update tab buttons
|
| 722 |
+
document.querySelectorAll('.content-tab').forEach(t => {
|
| 723 |
+
t.classList.remove('active', 'bg-blue-600', 'text-white');
|
| 724 |
+
t.classList.add('bg-gray-100', 'text-gray-700');
|
| 725 |
+
});
|
| 726 |
+
tab.classList.add('active', 'bg-blue-600', 'text-white');
|
| 727 |
+
tab.classList.remove('bg-gray-100', 'text-gray-700');
|
| 728 |
+
|
| 729 |
+
// Show selected content
|
| 730 |
+
const contentId = tab.getAttribute('data-content') + '-content';
|
| 731 |
+
document.querySelectorAll('#doc-content, #diagram-content').forEach(content => {
|
| 732 |
+
content.classList.add('hidden');
|
| 733 |
+
});
|
| 734 |
+
document.getElementById(contentId).classList.remove('hidden');
|
| 735 |
+
});
|
| 736 |
+
});
|
| 737 |
+
|
| 738 |
+
// Highlight code line
|
| 739 |
+
function highlightCodeLine(fileId, lineNumber) {
|
| 740 |
+
// First switch to the correct file tab
|
| 741 |
+
document.querySelectorAll('.code-file-tab').forEach(tab => {
|
| 742 |
+
if (tab.getAttribute('data-file') === fileId) {
|
| 743 |
+
tab.click();
|
| 744 |
+
}
|
| 745 |
+
});
|
| 746 |
+
|
| 747 |
+
// Then highlight the line (simplified for demo)
|
| 748 |
+
const fileContent = document.getElementById(fileId);
|
| 749 |
+
const codeLines = fileContent.querySelector('code').textContent.split('\n');
|
| 750 |
+
|
| 751 |
+
// Clear previous highlights
|
| 752 |
+
fileContent.querySelectorAll('.vulnerable-line').forEach(el => {
|
| 753 |
+
el.classList.remove('vulnerable-line');
|
| 754 |
+
});
|
| 755 |
+
|
| 756 |
+
// Highlight the line (in a real implementation would need more sophisticated line targeting)
|
| 757 |
+
const codeElement = fileContent.querySelector('code');
|
| 758 |
+
const lineElements = codeElement.querySelectorAll('.hljs-ln-line');
|
| 759 |
+
if (lineElements.length >= lineNumber) {
|
| 760 |
+
lineElements[lineNumber - 1].classList.add('vulnerable-line');
|
| 761 |
+
|
| 762 |
+
// Scroll to the line
|
| 763 |
+
lineElements[lineNumber - 1].scrollIntoView({ behavior: 'smooth', block: 'center' });
|
| 764 |
+
}
|
| 765 |
+
}
|
| 766 |
+
|
| 767 |
+
// Scroll to requirement
|
| 768 |
+
function scrollToRequirement(id) {
|
| 769 |
+
const element = document.getElementById(id);
|
| 770 |
+
if (element) {
|
| 771 |
+
// Switch to doc content if needed
|
| 772 |
+
document.querySelector('[data-content="doc"]').click();
|
| 773 |
+
|
| 774 |
+
// Scroll to element
|
| 775 |
+
element.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
| 776 |
+
|
| 777 |
+
// Add temporary highlight
|
| 778 |
+
element.style.backgroundColor = '#fef3c7';
|
| 779 |
+
setTimeout(() => {
|
| 780 |
+
element.style.backgroundColor = '';
|
| 781 |
+
}, 2000);
|
| 782 |
+
}
|
| 783 |
+
}
|
| 784 |
+
</script>
|
| 785 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=capta1n/projectdetail3" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 786 |
+
</html>
|
prompts.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
风险项目 AI SDL数字分身在每个环节发现的风险,最终将信息聚合成"某个项目在某个环节存在某风险" 的形式产出告警(项目是唯一维度,如果一个项目在多个环节存在风险需聚合在一起),例 支付宝国补项目在代码和需求环节存在越权和sql注入风险。 项目详情 告警出来的风险项目,点击进入详情页,将项目分为需求-代码-安全测试-发布-线上5个模块,每个模块都包含内容--安全分析结果,需要在内容上动态展示分析过程和同步展示风险对应的内容,因为安全分析是对内容进行分析最终产出安全分析结果。 需求模块: ● 内容:展示项目对应的需求文档文字内容以及技术架构图 ● 分析结果:需求对呀的STRIDE威胁建模图(集成mermaid.js)、安全风险:业务场景-风险点-风险类型-整改建议 代码模块: ● 内容:展示项目对应的多文件全部代码内容和接口地址 ● 分析结果:安全风险:漏洞名称、风险接口、漏洞类型、漏洞级别、漏洞描述、漏洞代码、修复建议 安全测试: ● 内容:展示对应的风险接口以及每个风险接口对应的攻击payload和攻击结果 ● 分析结果:风险接口地址、风险描述、攻击payload请求内容、攻击手法(1、攻击者登录自己的账号,获取一个合法的订单 ID(如 1001)2、修改请求中的 orderid 参数,尝试访问其他订单 ID(如 1002、1003 等)3、如果服务器未进行权限校验,攻击者将成功获取其他用户的订单信息4、通过自动化工具(如 Burp Suite 或编写脚本),攻击者可以批量枚举订单 ID,获取大量用户的敏感数据。) 发布: ● 内容:展示在发布环节进行安全检查的内容,检查之前环节积累下来的风险是否修复 ● 分析结果:未修复的风险,在之前的每个环节发现但未修复的风险,例代码环节的越权风险未修复 线上: ● 内容:展示发现的漏洞或者入侵事件风险 ● 分析结果:展示漏洞的修复情况 设计要求 每个模块的布局都是左右布局,左边展示原始内容、右边展示安全分析结果 需求模块:1、完整展示项目对应的需求内容,假设需求内容是一千字并且风险需求内容高亮展示 2、技术架构图支持缩放/平移(集成mermaid.js) 3、威胁建模图是对需求文档进行STRIDE威胁建模分析后集成mermaid.js展示威胁建模图 代码模块:1、代码高亮显示(支持多种语言) 2、漏洞代码行用红色填充标注,点击弹出修复建议浮层 3、展示多文件的代码内容结构 4、分析出来的漏洞代码点击后可以直接定位并且高亮对应的原文代码 安全测试模块:1、Payload展示采用代码块样式并支持修复 2、动态展示攻击过程,体现出攻击者的攻击手法和最终的攻击结果
|
| 2 |
+
请你按照我给你的要求进行优化 风险汇总 1、空间占比过大,可以适当缩小些 需求分析模块 1、需求文档内容和技术架构图布局上采用tab切换展示需求文档内容和技术架构 2、风险需求内容红色高亮展示 3、安全风险分析点击可以定位到对应的需求文档内容,不同风险等级展示不同的颜色 代码分析模块 1、不同风险等级展示不同的颜色 2、修复建议增加修复代码 3、风险代码进行红色高亮展示
|