From bc614d8370ceac9681e71dbce748795a73b659d1 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Tue, 11 Aug 2026 16:28:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(sve):=20=E6=B3=A8=E5=86=8C=20sve.gvsds.org?= =?UTF-8?q?=20=E5=AD=90=E5=9F=9F=E6=89=98=E7=AE=A1=20TempLate/SVE=EF=BC=8C?= =?UTF-8?q?=E9=87=8D=E6=9E=84=20SveID=20=E7=BC=96=E8=A7=A3=E7=A0=81?= =?UTF-8?q?=E5=B9=B6=E5=85=BC=E5=AE=B9=E5=AD=98=E9=87=8F=20CVSS=20?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - core/views.py 注册 sve 子域 -> SVE 目录 - sve/views.py:SveID 按 0x0YYYYNNNNN(5 字节 hex)编解码,兼容补零/文本存量形态;SveCvss 兼容小写键 score/severity/vector - 删除 TempLate/Org 原生 SVE 页面 - .gitignore 排除 /SVE/ 与 /TempLate/SVE/ --- .gitignore | 7 +- TempLate/Org/404.html | 242 ------------- TempLate/Org/assets/js/i18n.js | 571 ------------------------------- TempLate/Org/index.html | 575 ------------------------------- TempLate/Org/query.html | 409 ---------------------- TempLate/Org/template.html | 444 ------------------------ TempLate/Org/write.html | 598 --------------------------------- gvsds/apps/core/views.py | 1 + gvsds/apps/sve/views.py | 143 +++++--- 9 files changed, 98 insertions(+), 2892 deletions(-) delete mode 100644 TempLate/Org/404.html delete mode 100644 TempLate/Org/assets/js/i18n.js delete mode 100644 TempLate/Org/index.html delete mode 100644 TempLate/Org/query.html delete mode 100644 TempLate/Org/template.html delete mode 100644 TempLate/Org/write.html diff --git a/.gitignore b/.gitignore index 155d3833..8d2c0236 100644 --- a/.gitignore +++ b/.gitignore @@ -34,4 +34,9 @@ __pycache__/ # CCGO 做题站前端工程(独立 git 仓库) /CCGO/ # CCGO 的编译文件 -/TempLate/CCGO/ \ No newline at end of file +/TempLate/CCGO/ + +# SVE 前端工程(独立 git 仓库) +/SVE/ +# SVE 的编译文件 +/TempLate/SVE/ \ No newline at end of file diff --git a/TempLate/Org/404.html b/TempLate/Org/404.html deleted file mode 100644 index 846be5d9..00000000 --- a/TempLate/Org/404.html +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - 404 Not Found - SVE Database - - - - - - - - - - - -
-
-
-
- - SVE Database -
- - - - - - -
- - - - - - -
-
- - - -
-
- - -
-
- -
404
- - -
-

Page Not Found

-

- The page you're looking for doesn't exist or has been moved. Please check the URL or return to the homepage. -

-
- - - - - -
-
- - - - - - - - \ No newline at end of file diff --git a/TempLate/Org/assets/js/i18n.js b/TempLate/Org/assets/js/i18n.js deleted file mode 100644 index e99c9477..00000000 --- a/TempLate/Org/assets/js/i18n.js +++ /dev/null @@ -1,571 +0,0 @@ -// 合并后的完整多语言资源 -const i18nResources = { - en: { - // 基础导航与通用 - sve_database: "SVE Database", - home: "Home", - browse: "Browse", - search: "Search", - about: "About", - create_sve: "Create SVE", - documentation: "Documentation", - search_sve_placeholder: "Search SVE...", - - // 首页Hero区域 - hero_title: "GVSDS-Owned Projects Security / SMANAGE Vulnerability Exposure Database", - hero_desc: "A comprehensive repository of security vulnerabilities, providing detailed information for researchers, developers, and security professionals.", - hero_search_placeholder: "Search by SVE ID, CWE, keyword, or affected product...", - search_btn: "Search", - hero_example: "Example: SVE-2025-00012 or Cross-Site Scripting", - - // 统计数据 - stat_total_vuln: "Total Vulnerabilities", - stat_total_trend: "12% from last year", - stat_critical_vuln: "Critical Vulnerabilities", - stat_critical_trend: "8% from last year", - stat_this_month: "This Month", - stat_month_trend: "3% from last month", - stat_cwe_categories: "CWE Categories", - stat_cwe_trend: "5 new categories", - - // 图表相关 - chart_vuln_trends: "Vulnerability Trends", - severity_critical: "Critical", - severity_medium: "Medium", - severity_low: "Low", - chart_severity_dist: "Severity Distribution", - chart_top_cwe: "Top CWE Categories", - - // 最新SVE条目 - latest_sve: "Latest SVE Entries", - view_all: "View All", - table_sve_id: "SVE ID", - table_title: "Title", - table_severity: "Severity", - table_published: "Published", - table_cwe: "CWE", - - // 示例漏洞标题 - vuln_title_1: "Remote Code Execution in CloudPlatform v4.2.1", - vuln_title_2: "Privilege Escalation in AuthService v2.5.0", - vuln_title_3: "Information Disclosure in DataManager", - vuln_title_4: "Cross-Site Scripting in WebFramework v2.3.0", - vuln_title_5: "Weak Password Policy in UserManager", - - // 资源板块 - resource_doc: "Documentation", - resource_doc_desc: "Learn how to use the SVE database, understand vulnerability metrics, and interpret security ratings.", - read_doc: "Read Documentation", - resource_api: "API Access", - resource_api_desc: "Integrate SVE data into your applications with our comprehensive REST API and developer tools.", - explore_api: "Explore API", - resource_report: "Report Vulnerability", - resource_report_desc: "Submit a new security vulnerability for inclusion in the SVE database after verification.", - submit_report: "Submit Report", - - // 订阅板块 - subscribe_title: "Stay Updated on Security Vulnerabilities", - subscribe_desc: "Subscribe to our newsletter to receive weekly updates on new vulnerabilities, patches, and security trends.", - email_placeholder: "Your email address", - subscribe_btn: "Subscribe Now", - privacy_note: "We respect your privacy. Unsubscribe at any time.", - - // 创建SVE相关 - create_sve_title: "Create New SVE Entry", - create_sve_desc: "Fill in the following fields to create a new SVE entry. All required fields are marked with an asterisk (*).", - json_import_export_note: "You can import SVE data from JSON or export the current form as JSON", - import_json: "Import JSON", - export_json: "Export JSON", - sve_basic_info: "1. SVE Basic Information", - sve_id: "SVE ID *", - sve_year_placeholder: "YYYY", - sve_number_placeholder: "XXXXXX", - sve_id_format_note: "Format: SVE-YYYY-XXXXXX (e.g., SVE-2024-123456)", - publish_date: "Publish Date *", - vuln_title: "Vulnerability Title *", - vuln_title_placeholder: "e.g., Cross-Site Scripting Vulnerability in WebFramework v2.3.0", - vuln_status: "Vulnerability Status *", - vuln_status_draft: "Draft (Not Published)", - vuln_status_public: "Publicly Disclosed", - vuln_status_reserved: "Reserved (Pending Disclosure)", - vuln_description: "2. Vulnerability Description *", - vuln_description_note: "Describe the vulnerability in detail, including technical details, attack scenarios, and potential impacts. Support Markdown formatting.", - editor_edit_tab: "Edit", - editor_preview_tab: "Preview", - vuln_description_editor_placeholder: "# Vulnerability Description\n\n## Technical Details\nDescribe the technical details of the vulnerability here...\n\n## Attack Scenario\nExplain how an attacker could exploit this vulnerability...\n\n## Potential Impact\nList the potential impacts of this vulnerability...", - affected_products: "3. Affected Products *", - add_product: "Add Product", - affected_products_note: "List all products affected by this vulnerability. Include product name, version, and whether it's fixed in later versions.", - product_name: "Product Name *", - product_name_placeholder: "e.g., WebFramework", - product_version: "Affected Version(s) *", - product_version_placeholder: "e.g., v2.3.0, v2.2.x", - fixed_version: "Fixed Version (if any)", - fixed_version_placeholder: "e.g., v2.3.1, None", - remove_product: "Remove", - cvss_rating: "4. CVSS v3.1 Rating *", - cvss_rating_note: "Select the CVSS v3.1 metrics to calculate the base score. Refer to the SVE documentation for guidance on selecting appropriate metrics.", - attack_vector: "Attack Vector (AV) *", - av_network: "Network (N) - Exploitable remotely", - av_adjacent: "Adjacent (A) - Exploitable via adjacent network", - av_local: "Local (L) - Exploitable only locally", - av_physical: "Physical (P) - Requires physical access", - attack_complexity: "Attack Complexity (AC) *", - ac_low: "Low (L) - Minimal conditions", - ac_high: "High (H) - Specialized conditions", - privileges_required: "Privileges Required (PR) *", - pr_none: "None (N) - No privileges needed", - pr_low: "Low (L) - Basic privileges needed", - pr_high: "High (H) - Admin privileges needed", - user_interaction: "User Interaction (UI) *", - ui_none: "None (N) - No user interaction needed", - ui_required: "Required (R) - User action needed", - scope: "Scope (S) *", - s_unchanged: "Unchanged (U) - Impact limited to vulnerable component", - s_changed: "Changed (C) - Impact extends beyond vulnerable component", - confidentiality_impact: "Confidentiality (C) *", - c_none: "None (N) - No confidentiality impact", - c_low: "Low (L) - Limited confidentiality loss", - c_high: "High (H) - Complete confidentiality loss", - integrity_impact: "Integrity (I) *", - i_none: "None (N) - No integrity impact", - i_low: "Low (L) - Limited integrity loss", - i_high: "High (H) - Complete integrity loss", - availability_impact: "Availability (A) *", - a_none: "None (N) - No availability impact", - a_low: "Low (L) - Limited availability loss", - a_high: "High (H) - Complete availability loss", - cvss_base_score: "CVSS v3.1 Base Score", - cvss_vector_string: "CVSS Vector String", - solutions_mitigations: "5. Solutions and Mitigations", - solutions_mitigations_note: "Provide solutions, mitigations, and workarounds for the vulnerability. Support Markdown formatting (e.g., code blocks for workaround code).", - solutions_editor_placeholder: "# Solutions and Mitigations\n\n## Recommended Actions\n1. Upgrade to the latest version\n2. Apply security patches\n\n## Workaround (if upgrade not possible)\n```javascript\n// Example workaround code\nfunction sanitizeInput(input) {\n return input.replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>');\n}\n```\n\n## Additional Guidance\nProvide any additional guidance for users...", - references: "6. References", - add_reference: "Add Reference", - references_note: "Add references related to the vulnerability (e.g., vendor advisories, technical papers, SVE documentation links). Do not include CVE or CWE references.", - reference_type: "Reference Type *", - ref_vendor: "Vendor Advisory", - ref_tech_doc: "Technical Documentation", - ref_sve_guide: "SVE Guidance", - ref_research: "Research Paper", - ref_other: "Other", - reference_title: "Reference Title", - reference_title_placeholder: "e.g., WebFramework Security Advisory 2024-01", - reference_url: "Reference URL *", - reference_url_placeholder: "https://example.com/security/advisory", - remove_reference: "Remove", - related_sve: "7. Related SVE Entries", - add_related_sve: "Add Related SVE", - related_sve_note: "Add other SVE entries that are related to this vulnerability (e.g., same product family, similar attack vector).", - related_sve_id_placeholder: "SVE-YYYY-XXXXXX", - related_same_product: "Same Product", - related_similar_vuln: "Similar Vulnerability", - related_same_vendor: "Same Vendor", - related_other: "Other Relationship", - remove_related_sve: "Remove Related SVE", - save_draft: "Save as Draft", - submit_sve: "Submit SVE Entry", - - // SVE详情页相关 - copy_sve_id: "Copy SVE ID", - copied: "Copied!", - description: "Description", - vector: "Vector", - vendor_advisory: "Vendor Advisory:", - vulnerability_details: "Vulnerability Details", - status: "Status", - publicly_disclosed: "Publicly Disclosed", - related_sve_entries: "Related SVE Entries", - medium: "MEDIUM", - high: "HIGH", - critical: "CRITICAL", - low: "LOW", - none: "NONE", - view_all_related: "View All Related", - get_updates: "Get Updates", - subscribe_desc: "Subscribe to receive notifications about changes to this SVE entry.", - subscribe: "Subscribe", - cve_compatibility: "CVE Compatibility", - accessibility: "Accessibility", - published: "Published:", - last_modified: "Last Modified:", - no_related_sves: "No related SVE entries found.", - no_fixed_version: "No fixed version", - - // CVSS简化显示文本 - av_network: "Network", - av_adjacent: "Adjacent", - av_local: "Local", - av_physical: "Physical", - ac_low: "Low", - ac_high: "High", - pr_none: "None", - pr_low: "Low", - pr_high: "High", - ui_none: "None", - ui_required: "Required", - s_unchanged: "Unchanged", - s_changed: "Changed", - c_none: "None", - c_low: "Low", - c_high: "High", - i_none: "None", - i_low: "Low", - i_high: "High", - a_none: "None", - a_low: "Low", - a_high: "High", - - // 错误页面 - error_404_title: "Page Not Found", - error_404_desc: "The page you're looking for doesn't exist or has been moved. Please check the URL or return to the homepage.", - error_back_home: "Back to Homepage", - error_search_again: "Refresh Page", - error_search_sve: "Search for SVE entries:", - error_search_placeholder: "Enter SVE ID or keyword...", - - // SVE列表页新增 - sve_list_title: "SVE Vulnerability List", - sve_list_desc: "Display all publicly disclosed SVE vulnerabilities with multi-dimensional filtering and pagination", - total_vulns: "Total Vulnerabilities:", - current_page: "Current Page:", - advanced_filter: "Advanced Filter", - filter_title: "Vulnerability Title", - filter_title_placeholder: "Search by keyword", - filter_cvss_severity: "CVSS Severity", - filter_publish_year: "Publish Year", - filter_page_size: "Items per Page", - filter_all: "All", - apply_filter: "Apply Filters", - reset_filter: "Reset Filters", - attack_vector: "Attack Vector (AV)", - attack_complexity: "Attack Complexity (AC)", - privileges_required: "Privileges Required (PR)", - av_network: "Network (N)", - av_adjacent: "Adjacent (A)", - av_local: "Local (L)", - av_physical: "Physical (P)", - ac_low: "Low (L)", - ac_high: "High (H)", - pr_none: "None (N)", - pr_low: "Low (L)", - pr_high: "High (H)", - sve_id: "SVE ID", - vuln_title: "Vulnerability Title", - cvss_score: "CVSS Score", - severity: "Severity", - publish_date: "Publish Date", - actions: "Actions", - loading_data: "Loading data...", - no_results: "No matching vulnerabilities found", - reset_filters: "Reset filters", - load_error: "Failed to load data", - retry: "Retry", - critical: "Critical", - high: "High", - medium: "Medium", - low: "Low", - view_details: "View Details", - - // 页脚 - footer_desc: "A comprehensive database of security vulnerabilities and exposures, maintained by the Security Research Team.", - footer_resources: "Resources", - api: "API", - bulk_data: "Bulk Data", - statistics: "Statistics", - footer_information: "Information", - about_sve: "About SVE", - vuln_metrics: "Vulnerability Metrics", - faq: "FAQ", - footer_contact: "Contact", - report_vuln: "Report a Vulnerability", - security_policy: "Security Policy", - copyright: "© 2025 SVE Database. All rights reserved.", - privacy_policy: "Privacy Policy", - terms_service: "Terms of Service" - }, - zh: { - // 基础导航与通用 - sve_database: "SVE 数据库", - home: "首页", - browse: "浏览", - search: "搜索", - about: "关于我们", - create_sve: "创建 SVE", - documentation: "文档", - search_sve_placeholder: "搜索 SVE...", - - // 首页Hero区域 - hero_title: "GVSDS 旗下项目安全(SMANAGE)漏洞暴露数据库", - hero_desc: "全面的安全漏洞知识库,为研究人员、开发人员和安全专业人员提供详细信息。", - hero_search_placeholder: "按 SVE ID、CWE、关键词或受影响产品搜索...", - search_btn: "搜索", - hero_example: "示例:SVE-2025-00012 或 跨站脚本攻击(XSS)", - - // 统计数据 - stat_total_vuln: "漏洞总数", - stat_total_trend: "较去年增长 12%", - stat_critical_vuln: "严重漏洞数", - stat_critical_trend: "较去年增长 8%", - stat_this_month: "本月新增", - stat_month_trend: "较上月下降 3%", - stat_cwe_categories: "CWE 类别数", - stat_cwe_trend: "新增 5 个类别", - - // 图表相关 - chart_vuln_trends: "漏洞趋势", - severity_critical: "严重", - severity_medium: "中等", - severity_low: "低级", - chart_severity_dist: "漏洞严重程度分布", - chart_top_cwe: "热门 CWE 类别", - - // 最新SVE条目 - latest_sve: "最新 SVE 条目", - view_all: "查看全部", - table_sve_id: "SVE 编号", - table_title: "标题", - table_severity: "严重程度", - table_published: "发布时间", - table_cwe: "CWE 编号", - - // 示例漏洞标题 - vuln_title_1: "CloudPlatform v4.2.1 远程代码执行漏洞", - vuln_title_2: "AuthService v2.5.0 权限提升漏洞", - vuln_title_3: "DataManager 信息泄露漏洞", - vuln_title_4: "WebFramework v2.3.0 跨站脚本漏洞", - vuln_title_5: "UserManager 弱密码策略漏洞", - - // 资源板块 - resource_doc: "文档中心", - resource_doc_desc: "学习如何使用 SVE 数据库、理解漏洞指标以及解读安全评级。", - read_doc: "阅读文档", - resource_api: "API 接口", - resource_api_desc: "通过我们全面的 REST API 和开发工具,将 SVE 数据集成到您的应用中。", - explore_api: "探索 API", - resource_report: "漏洞上报", - resource_report_desc: "提交新的安全漏洞,经审核后将纳入 SVE 数据库。", - submit_report: "提交报告", - - // 订阅板块 - subscribe_title: "及时获取安全漏洞更新", - subscribe_desc: "订阅我们的通讯,每周获取新漏洞、补丁和安全趋势的更新。", - email_placeholder: "您的邮箱地址", - subscribe_btn: "立即订阅", - privacy_note: "我们尊重您的隐私,可随时取消订阅。", - - // 创建SVE相关 - create_sve_title: "创建新的 SVE 条目", - create_sve_desc: "填写以下字段以创建新的 SVE 条目。所有必填字段均标有星号 (*)。", - json_import_export_note: "您可以从 JSON 导入 SVE 数据,或将当前表单导出为 JSON", - import_json: "导入 JSON", - export_json: "导出 JSON", - sve_basic_info: "1. SVE 基础信息", - sve_id: "SVE 编号 *", - sve_year_placeholder: "年份", - sve_number_placeholder: "编号(6位)", - sve_id_format_note: "格式:SVE-年份-6位编号(例如:SVE-2024-123456)", - publish_date: "发布日期 *", - vuln_title: "漏洞标题 *", - vuln_title_placeholder: "例如:WebFramework v2.3.0 中的跨站脚本漏洞", - vuln_status: "漏洞状态 *", - vuln_status_draft: "草稿(未发布)", - vuln_status_public: "已公开披露", - vuln_status_reserved: "保留(待披露)", - vuln_description: "2. 漏洞描述 *", - vuln_description_note: "详细描述漏洞,包括技术细节、攻击场景和潜在影响。支持 Markdown 格式。", - editor_edit_tab: "编辑", - editor_preview_tab: "预览", - vuln_description_editor_placeholder: "# 漏洞描述\n\n## 技术细节\n在此处描述漏洞的技术细节...\n\n## 攻击场景\n解释攻击者如何利用此漏洞...\n\n## 潜在影响\n列出此漏洞的潜在影响...", - affected_products: "3. 受影响产品 *", - add_product: "添加产品", - affected_products_note: "列出所有受此漏洞影响的产品,包括产品名称、版本以及后续版本是否已修复。", - product_name: "产品名称 *", - product_name_placeholder: "例如:WebFramework", - product_version: "受影响版本 *", - product_version_placeholder: "例如:v2.3.0、v2.2.x", - fixed_version: "修复版本(如有)", - fixed_version_placeholder: "例如:v2.3.1、无", - remove_product: "删除", - cvss_rating: "4. CVSS v3.1 评分 *", - cvss_rating_note: "选择 CVSS v3.1 指标以计算基础评分。有关选择适当指标的指导,请参考 SVE 文档。", - attack_vector: "攻击向量 (AV) *", - av_network: "网络 (N) - 可远程利用", - av_adjacent: "相邻 (A) - 可通过相邻网络利用", - av_local: "本地 (L) - 仅可本地利用", - av_physical: "物理 (P) - 需要物理访问", - attack_complexity: "攻击复杂度 (AC) *", - ac_low: "低 (L) - 条件简单", - ac_high: "高 (H) - 条件特殊", - privileges_required: "所需权限 (PR) *", - pr_none: "无 (N) - 无需权限", - pr_low: "低 (L) - 需要基本权限", - pr_high: "高 (H) - 需要管理员权限", - user_interaction: "用户交互 (UI) *", - ui_none: "无 (N) - 无需用户交互", - ui_required: "需要 (R) - 需要用户操作", - scope: "影响范围 (S) *", - s_unchanged: "未变更 (U) - 影响仅限于漏洞组件", - s_changed: "已变更 (C) - 影响超出漏洞组件", - confidentiality_impact: "机密性 (C) *", - c_none: "无 (N) - 无机密性影响", - c_low: "低 (L) - 机密性有限损失", - c_high: "高 (H) - 机密性完全损失", - integrity_impact: "完整性 (I) *", - i_none: "无 (N) - 无完整性影响", - i_low: "低 (L) - 完整性有限损失", - i_high: "高 (H) - 完整性完全损失", - availability_impact: "可用性 (A) *", - a_none: "无 (N) - 无可用性影响", - a_low: "低 (L) - 可用性有限损失", - a_high: "高 (H) - 可用性完全损失", - cvss_base_score: "CVSS v3.1 基础评分", - cvss_vector_string: "CVSS 向量字符串", - solutions_mitigations: "5. 解决方案与缓解措施", - solutions_mitigations_note: "提供漏洞的解决方案、缓解措施和临时规避方法。支持 Markdown 格式(例如,用于规避代码的代码块)。", - solutions_editor_placeholder: "# 解决方案与缓解措施\n\n## 推荐操作\n1. 升级到最新版本\n2. 应用安全补丁\n\n## 临时规避方法(如无法立即升级)\n```javascript\n// 示例规避代码\nfunction sanitizeInput(input) {\n return input.replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>');\n}\n```\n\n## 额外指导\n为用户提供任何额外指导...", - references: "6. 参考资料", - add_reference: "添加参考资料", - references_note: "添加与漏洞相关的参考资料(例如,厂商公告、技术文档、SVE 文档链接)。请勿包含 CVE 或 CWE 参考资料。", - reference_type: "参考资料类型 *", - ref_vendor: "厂商公告", - ref_tech_doc: "技术文档", - ref_sve_guide: "SVE 指导文档", - ref_research: "研究论文", - ref_other: "其他", - reference_title: "参考资料标题", - reference_title_placeholder: "例如:WebFramework 安全公告 2024-01", - reference_url: "参考资料 URL *", - reference_url_placeholder: "https://example.com/security/advisory", - remove_reference: "删除", - related_sve: "7. 相关 SVE 条目", - add_related_sve: "添加相关 SVE", - related_sve_note: "添加与此漏洞相关的其他 SVE 条目(例如,同一产品系列、类似攻击向量)。", - related_sve_id_placeholder: "SVE-年份-6位编号", - related_same_product: "同一产品", - related_similar_vuln: "类似漏洞", - related_same_vendor: "同一厂商", - related_other: "其他关系", - remove_related_sve: "删除相关 SVE", - save_draft: "保存为草稿", - submit_sve: "提交 SVE 条目", - - // SVE详情页相关 - copy_sve_id: "复制 SVE 编号", - copied: "已复制!", - description: "漏洞描述", - vector: "向量", - vendor_advisory: "厂商公告:", - vulnerability_details: "漏洞详情", - status: "状态", - publicly_disclosed: "已公开披露", - related_sve_entries: "相关 SVE 条目", - medium: "中等", - high: "高危", - critical: "严重", - low: "低危", - none: "无", - view_all_related: "查看全部相关", - get_updates: "获取更新", - subscribe_desc: "订阅以接收此 SVE 条目的变更通知。", - subscribe: "订阅", - cve_compatibility: "CVE 兼容性", - accessibility: "无障碍访问", - published: "发布时间:", - last_modified: "最后更新:", - no_related_sves: "未找到相关 SVE 条目。", - no_fixed_version: "无修复版本", - - // CVSS简化显示文本 - av_network: "网络", - av_adjacent: "相邻网络", - av_local: "本地", - av_physical: "物理", - ac_low: "低", - ac_high: "高", - pr_none: "无", - pr_low: "低", - pr_high: "高", - ui_none: "无", - ui_required: "需要", - s_unchanged: "未变更", - s_changed: "已变更", - c_none: "无", - c_low: "低", - c_high: "高", - i_none: "无", - i_low: "低", - i_high: "高", - a_none: "无", - a_low: "低", - a_high: "高", - - // 错误页面 - error_404_title: "页面未找到", - error_404_desc: "您访问的页面不存在或已被移动,请检查URL地址或返回首页。", - error_back_home: "返回首页", - error_search_again: "重新访问", - error_search_sve: "搜索SVE条目:", - error_search_placeholder: "输入SVE编号或关键词...", - - // SVE列表页新增 - sve_list_title: "SVE漏洞列表", - sve_list_desc: "展示所有已公开的SVE漏洞信息,支持多维度筛选和分页查询", - total_vulns: "总漏洞数:", - current_page: "当前页:", - advanced_filter: "高级筛选", - filter_title: "漏洞标题", - filter_title_placeholder: "输入关键词搜索", - filter_cvss_severity: "CVSS严重级别", - filter_publish_year: "发布年份", - filter_page_size: "每页条数", - filter_all: "全部", - apply_filter: "应用筛选", - reset_filter: "重置筛选", - attack_vector: "攻击向量(AV)", - attack_complexity: "攻击复杂度(AC)", - privileges_required: "所需权限(PR)", - av_network: "网络(N)", - av_adjacent: "相邻网络(A)", - av_local: "本地(L)", - av_physical: "物理(P)", - ac_low: "低(L)", - ac_high: "高(H)", - pr_none: "无(N)", - pr_low: "低(L)", - pr_high: "高(H)", - sve_id: "SVE编号", - vuln_title: "漏洞标题", - cvss_score: "CVSS评分", - severity: "严重级别", - publish_date: "发布日期", - actions: "操作", - loading_data: "加载数据中...", - no_results: "未找到符合条件的漏洞", - reset_filters: "重置筛选条件", - load_error: "数据加载失败", - retry: "重试", - critical: "严重", - high: "高危", - medium: "中等", - low: "低危", - view_details: "查看详情", - - // 页脚 - footer_desc: "由安全研究团队维护的全面安全漏洞与暴露数据库。", - footer_resources: "资源中心", - api: "API接口", - bulk_data: "批量数据", - statistics: "统计数据", - footer_information: "相关信息", - about_sve: "关于SVE", - vuln_metrics: "漏洞指标", - faq: "常见问题", - footer_contact: "联系我们", - report_vuln: "上报漏洞", - security_policy: "安全政策", - copyright: "© 2025 SVE数据库 保留所有权利。", - privacy_policy: "隐私政策", - terms_service: "服务条款" - } -}; \ No newline at end of file diff --git a/TempLate/Org/index.html b/TempLate/Org/index.html deleted file mode 100644 index ad363135..00000000 --- a/TempLate/Org/index.html +++ /dev/null @@ -1,575 +0,0 @@ - - - - - - SVE Database - GVSDS-Owned Projects Security / SMANAGE Vulnerability Exposure Database - - - - - - - - - - - - -
-
-
-
- - SVE Database -
- - - - - - -
- - - - - - -
-
- - - -
-
- - -
-
-
-

GVSDS-Owned Projects Security / SMANAGE Vulnerability Exposure Database

-

A comprehensive repository of security vulnerabilities, providing detailed information for researchers, developers, and security professionals.

- - -
- - -
- - -
-
-
- - -
- -
-
-
-
-

Total Vulnerabilities

-

12,847

-
-
- -
-
-
- 12% from last year -
-
- -
-
-
-

Critical Vulnerabilities

-

1,423

-
-
- -
-
-
- 8% from last year -
-
- -
-
-
-

This Month

-

247

-
-
- -
-
-
- 3% from last month -
-
- -
-
-
-

CWE Categories

-

97

-
-
- -
-
-
- 5 new categories -
-
-
- - -
- -
-

Vulnerability Trends

-
- -
-
-
- - Critical -
-
- - Medium -
-
- - Low -
-
-
- - -
-

Severity Distribution

-
- -
-
-
-
11%
-
Critical
-
-
-
45%
-
Medium
-
-
-
44%
-
Low
-
-
-
- - -
-

Top CWE Categories

-
-
-
- CWE-79 (XSS) - 1,842 -
-
-
-
-
-
-
- CWE-89 (SQL Injection) - 1,567 -
-
-
-
-
-
-
- CWE-20 (Input Validation) - 1,245 -
-
-
-
-
-
-
- CWE-352 (CSRF) - 987 -
-
-
-
-
-
-
- CWE-434 (File Upload) - 765 -
-
-
-
-
-
-
-
- - -
-
-

Latest SVE Entries

- - View All - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SVE IDTitleSeverityPublishedCWE
- SVE-2025-00001 - - Remote Code Execution in CloudPlatform v4.2.1 - - CRITICAL - 2023-08-28 - CWE-78 -
- SVE-2025-00001 - - Privilege Escalation in AuthService v2.5.0 - - CRITICAL - 2023-08-27 - CWE-269 -
- SVE-2023-56787 - - Information Disclosure in DataManager - - MEDIUM - 2023-08-26 - CWE-200 -
- SVE-2023-45678 - - Cross-Site Scripting in WebFramework v2.3.0 - - MEDIUM - 2023-08-25 - CWE-79 -
- SVE-2023-56786 - - Weak Password Policy in UserManager - - LOW - 2023-08-24 - CWE-521 -
-
-
- - -
-
-
- -
-

Documentation

-

Learn how to use the SVE database, understand vulnerability metrics, and interpret security ratings.

- - Read Documentation - -
- -
-
- -
-

API Access

-

Integrate SVE data into your applications with our comprehensive REST API and developer tools.

- - Explore API - -
- -
-
- -
-

Report Vulnerability

-

Submit a new security vulnerability for inclusion in the SVE database after verification.

- - Submit Report - -
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/TempLate/Org/query.html b/TempLate/Org/query.html deleted file mode 100644 index 9deff7d8..00000000 --- a/TempLate/Org/query.html +++ /dev/null @@ -1,409 +0,0 @@ - - - - - - SVE漏洞列表 - SVE Database - - - - - - - - - - - - -
-
-
-
- - SVE Database -
- - - - - - -
- - - - - - -
-
- - - -
-
- - -
- -
-

SVE漏洞列表

-

- 展示所有已公开的SVE漏洞信息,支持多维度筛选和分页查询 -

-
- 总漏洞数: - 0 - 当前页: - 1 / 0 -
-
- - -
- - - - -
- - -
- - - - -
- -
-
-

加载数据中...

-
- - - - - - - - -
-
- - -
-
- 1 - 10 条,共 0 条 -
-
- -
- -
- -
-
-
- - - - - - - - diff --git a/TempLate/Org/template.html b/TempLate/Org/template.html deleted file mode 100644 index ba76c842..00000000 --- a/TempLate/Org/template.html +++ /dev/null @@ -1,444 +0,0 @@ - - - - - - SVE Details - SVE Database - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- - SVE Database -
- - - - - - -
- - - - - - -
-
- - - -
-
- -
- -
- Home > - SVE-2025-00000 -
- - -
-
-
-
-
-

SVE-0000-00000

- - -
-
-

TITLE...

-
-
-
- - Published: 2025-08-29 -
-
- - Last Modified: 2025-08-29 -
-
-
- -
-

- - Description -

-
- -
-
-
- -
-
CVSS v3.1 Base Score
-
- ?.? - ??? -
-
- Vector: CVSS:3.1/?? -
- -
- -
-
-
-
- - -
- -
- -
-

- - Affected Products -

-
    - -
-
- - -
-

- - Solutions and Mitigations -

-
- -
-
- - -
-

- - References -

-
    - -
-
-
- - -
- -
-

Vulnerability Details

- -
- -
-
- - -
-

Related SVE Entries

-
- -
- -
- - -
-
-
- - - - - - - - \ No newline at end of file diff --git a/TempLate/Org/write.html b/TempLate/Org/write.html deleted file mode 100644 index 8c8b3aef..00000000 --- a/TempLate/Org/write.html +++ /dev/null @@ -1,598 +0,0 @@ - - - - - - Create New SVE Entry - SVE Database - - - - - - - - - - - - - - - - -
-
-
-
- - SVE Database -
- - - - - - -
- - - - - - -
-
- - - -
-
- - -
- -
- Home > - Create New SVE Entry -
- - -
-

Create New SVE Entry

-

Fill in the following fields to create a new SVE entry. All required fields are marked with an asterisk (*).

-
- - -
-
- - You can import SVE data from JSON or export the current form as JSON -
-
- - - - -
-
- - -
- -
-

1. SVE Basic Information

- -
- -
- -
- SVE- - - - - -
-

Format: SVE-YYYY-XXXXXX (e.g., SVE-2024-123456)

-
- - -
- - -
-
- -
- -
- - -
- - -
- - -
-
-
- - -
-

2. Vulnerability Description *

-

Describe the vulnerability in detail, including technical details, attack scenarios, and potential impacts. Support Markdown formatting.

- - -
-
-
Edit
-
Preview
-
- - -
-
- - -
-
-

3. Affected Products *

- -
-

List all products affected by this vulnerability. Include product name, version, and whether it's fixed in later versions.

- - -
- -
-
-
- - -
-
- - -
-
- - -
-
- -
-
-
- - -
-

4. CVSS v3.1 Rating *

-

Select the CVSS v3.1 metrics to calculate the base score. Refer to the SVE documentation for guidance on selecting appropriate metrics.

- -
- -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
-
- - -
-
-
-
CVSS v3.1 Base Score
-
- 6.1 - MEDIUM -
-
-
-
CVSS Vector String
-
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
-
-
-
-
- - -
-

5. Solutions and Mitigations

-

Provide solutions, mitigations, and workarounds for the vulnerability. Support Markdown formatting (e.g., code blocks for workaround code).

- - -
-
-
Edit
-
Preview
-
- - -
-
- - -
-
-

6. References

- -
-

Add references related to the vulnerability (e.g., vendor advisories, technical papers, SVE documentation links). Do not include CVE or CWE references.

- - -
- -
-
-
- - -
-
- - -
-
- - -
-
- -
-
-
- - -
-
-

7. Related SVE Entries

- -
-

Add other SVE entries that are related to this vulnerability (e.g., same product family, similar attack vector).

- - -
- - -
-
- - -
- - -
-
-
- - - - - - - - \ No newline at end of file diff --git a/gvsds/apps/core/views.py b/gvsds/apps/core/views.py index af6f27a6..db11dfaf 100644 --- a/gvsds/apps/core/views.py +++ b/gvsds/apps/core/views.py @@ -52,6 +52,7 @@ SUBDOMAIN_CONFIG = { 'cdn': {'dir': 'cdn', 'root_is_index': False, 'root_text': 'GVSDS CDN'}, 'yc8z': {'dir': 'yc8z', 'root_is_index': True}, 'omc': {'dir': 'omc', 'root_is_index': True}, + 'sve': {'dir': 'SVE', 'root_is_index': True}, 'tailwind': {'dir': 'Tailwindcss', 'root_is_index': False, 'root_redirect': '/3.4.17'}, 'nanjingmassacre': {'dir': 'NanjingMassacre', 'root_is_index': True}, '3c': {'dir': 'CreateECentralCourt', 'root_is_index': True}, diff --git a/gvsds/apps/sve/views.py b/gvsds/apps/sve/views.py index beab29d2..4aa0e0fc 100644 --- a/gvsds/apps/sve/views.py +++ b/gvsds/apps/sve/views.py @@ -1,38 +1,81 @@ """模块:SVE 安全漏洞百科视图 -提供漏洞查询、写入、列表筛选功能。""" +提供漏洞查询、写入、列表筛选功能。 -import uuid +SveID 存储规范(用户定案):5 字节二进制,hex 形式 0x0YYYYNNNNN + - YYYY:4 位年份(hex 数字,如 2023 → '2023') + - NNNNN:5 位数字编号(hex 数字,如 00001) + 例:SVE-2023-00001 ⇄ 字节 02 02 30 00 01(hex 0202300001) +""" + +import re import datetime from rest_framework import viewsets from rest_framework.decorators import action from rest_framework.response import Response -from rest_framework.permissions import IsAuthenticated, AllowAny +from rest_framework.permissions import AllowAny from django.db.models import Q from .models import SVEBase from .serializers import SVESerializer, SVEListSerializer, SVEWriteSerializer -from gvsdsdk.model_utils import UUIDObj -def _sve_id_to_bytes(sve_id_str): - sve_id_str = sve_id_str.strip().upper() - if sve_id_str.startswith('SVE-'): - sve_id_str = sve_id_str[4:] - parts = sve_id_str.split('-') - if len(parts) == 3: +def _sve_id_to_bytes(sve_id): + """SVE-YYYY-NNNNN(或 0x0YYYYNNNNN / 0YYYYNNNNN)→ 5 字节二进制 ID。 + + 无效格式抛 ValueError,由调用方转为 400 响应。 + """ + s = str(sve_id).strip() + m = re.fullmatch(r'SVE[-_ ]?(\d{4})[-_ ]?(\d+)', s, re.IGNORECASE) + if m: + year, count = m.group(1), m.group(2) + # 编号按十进制解析后补足 5 位(如 00012 → '00012'),拼成 hex 0+年份+编号 + return bytes.fromhex(f'0{year}{int(count):05d}') + hex_str = s[2:] if s.lower().startswith('0x') else s + if len(hex_str) == 10 and re.fullmatch(r'[0-9a-fA-F]{10}', hex_str): + return bytes.fromhex(hex_str) + raise ValueError(f'无效的 SveID 格式: {sve_id},期望 SVE-YYYY-NNNNN') + + +def _format_sve_id(sve_id): + """5 字节 ID → SVE-YYYY-NNNNN;兼容 16 字节补零 / UTF-8 文本等存量形态。""" + if isinstance(sve_id, bytes): + hex_str = sve_id.hex() + # 规范形态:10 位 hex 且首字符为 0(0x0YYYYNNNNN) + if len(sve_id) == 5 and hex_str.startswith('0'): + return f'SVE-{hex_str[1:5]}-{hex_str[5:]}' + # 兼容旧补零存储:去掉尾部 \x00 后重试 + stripped = sve_id.rstrip(b'\x00') + if stripped != sve_id: + return _format_sve_id(stripped) + # 兼容 UTF-8 文本形态(旧字符串存储) try: - year = int(parts[0]) - count = int(parts[2]) - return f'SVE-{year}-{count:04d}' - except (ValueError, IndexError): + text = sve_id.decode('utf-8') + if text.startswith('SVE-'): + return text + except UnicodeDecodeError: pass - return sve_id_str + return hex_str + return str(sve_id) -def _format_sve_id(sve_id_bytes): - if isinstance(sve_id_bytes, bytes): - return UUIDObj(sve_id_bytes).str or sve_id_bytes.hex() - return str(sve_id_bytes) +def _detail_data(sve): + """详情页统一载荷(SveID 转 SVE-YYYY-NNNNN 可读文本)。""" + cvss_data = sve.SveCvss or {} + return { + 'SveID': _format_sve_id(sve.SveID), + 'SveName': sve.SveName, + 'SveDescription': sve.SveDescription, + 'SveVulnStatus': sve.SveVulnStatus, + 'SveProducts': sve.SveProducts, + 'SveCvss': sve.SveCvss, + 'CvssBaseScore': cvss_data.get('score', cvss_data.get('baseScore')), + 'CvssBaseSeverity': cvss_data.get('severity', cvss_data.get('baseSeverity')), + 'SveSolutions': sve.SveSolutions, + 'SveReferences': sve.SveReferences, + 'SveRelatedSves': sve.SveRelatedSves, + 'SveCreateTime': sve.SveCreateTime.isoformat() if sve.SveCreateTime else None, + 'SveLastModified': sve.SveLastModified.isoformat() if sve.SveLastModified else None, + } class SVEViewSet(viewsets.ModelViewSet): @@ -67,7 +110,7 @@ class SVEViewSet(viewsets.ModelViewSet): filtered = [] for sve in all_sves: cvss_data = sve.SveCvss or {} - score = cvss_data.get('baseScore', 0) + score = cvss_data.get('score', cvss_data.get('baseScore', 0)) if CvssMin <= score <= CvssMax: filtered.append(sve) qs = filtered @@ -93,8 +136,8 @@ class SVEViewSet(viewsets.ModelViewSet): 'SveName': sve.SveName, 'SveDescription': (sve.SveDescription or '')[:200], 'SveVulnStatus': sve.SveVulnStatus, - 'CvssBaseScore': cvss_data.get('baseScore'), - 'CvssSeverity': cvss_data.get('baseSeverity'), + 'CvssBaseScore': cvss_data.get('score', cvss_data.get('baseScore')), + 'CvssSeverity': cvss_data.get('severity', cvss_data.get('baseSeverity')), 'SveCreateTime': sve.SveCreateTime.isoformat() if sve.SveCreateTime else None, }) @@ -111,42 +154,38 @@ class SVEViewSet(viewsets.ModelViewSet): SveID = request.query_params.get('SveID') or request.data.get('SveID') if not SveID: return Response({'code': 1, 'msg': '缺少SveID'}, status=400) - formatted_id = _sve_id_to_bytes(SveID) try: - sve = SVEBase.objects.get(SveID=formatted_id.encode('utf-8')[:16].ljust(16, b'\x00')) - except SVEBase.DoesNotExist: - try: - sve = SVEBase.objects.get(SveID=SveID) - except SVEBase.DoesNotExist: - return Response({'code': 1, 'msg': 'SVE不存在'}, status=404) + sve_id_bytes = _sve_id_to_bytes(SveID) + except ValueError as e: + return Response({'code': 1, 'msg': str(e)}, status=400) - cvss_data = sve.SveCvss or {} - return Response({ - 'code': 0, - 'data': { - 'SveID': _format_sve_id(sve.SveID), - 'SveName': sve.SveName, - 'SveDescription': sve.SveDescription, - 'SveVulnStatus': sve.SveVulnStatus, - 'SveProducts': sve.SveProducts, - 'SveCvss': sve.SveCvss, - 'CvssBaseScore': cvss_data.get('baseScore'), - 'CvssBaseSeverity': cvss_data.get('baseSeverity'), - 'SveSolutions': sve.SveSolutions, - 'SveReferences': sve.SveReferences, - 'SveRelatedSves': sve.SveRelatedSves, - 'SveCreateTime': sve.SveCreateTime.isoformat() if sve.SveCreateTime else None, - 'SveLastModified': sve.SveLastModified.isoformat() if sve.SveLastModified else None, - } - }) + # 依次尝试:规范 5 字节 → 旧补零 16 字节 → 旧 UTF-8 文本字节 + candidates = ( + sve_id_bytes, + SveID.encode('utf-8')[:16].ljust(16, b'\x00'), + SveID.encode('utf-8'), + ) + sve = None + for candidate in candidates: + try: + sve = SVEBase.objects.get(SveID=candidate) + break + except SVEBase.DoesNotExist: + continue + if sve is None: + return Response({'code': 1, 'msg': 'SVE不存在'}, status=404) + + return Response({'code': 0, 'data': _detail_data(sve)}) @action(detail=False, methods=['post']) def write(self, request): ser = SVEWriteSerializer(data=request.data) ser.IsValid(raise_exception=True) data = ser.ValidatedData - formatted_id = _sve_id_to_bytes(data['SveID']) - sve_id_bytes = formatted_id.encode('utf-8')[:16].ljust(16, b'\x00') + try: + sve_id_bytes = _sve_id_to_bytes(data['SveID']) + except ValueError as e: + return Response({'code': 1, 'msg': str(e)}, status=400) defaults = { 'SveName': data.get('SveName', ''), @@ -171,5 +210,5 @@ class SVEViewSet(viewsets.ModelViewSet): return Response({ 'code': 0, 'msg': '创建成功' if created else '更新成功', - 'data': SVESerializer(sve).data, - }) \ No newline at end of file + 'data': _detail_data(sve), + })