Skip to main content

secure-file-uploads

Secure file uploads through strict acceptance rules, isolated storage, content inspection, and authorized delivery. Use when users or integrations can place files into an application.

来源信息

仓库
protosphinx/sphinxstack
最近来源活动
2026年7月29日 13:55
检测到的 SKILL.md 语言
英语
星标
3
Forks
0

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
2 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
secure-file-uploads
category
code
description
Secure file uploads through strict acceptance rules, isolated storage, content inspection, and authorized delivery. Use when users or integrations can place files into an application.
# secure-file-uploads Treat every uploaded byte and filename as untrusted, including files from authenticated users. ## Procedure 1. Define allowed business uses, file categories, sizes, counts, owners, retention, and download audiences. 2. Enforce request and decompressed-size limits before expensive parsing or storage. 3. Check extension, declared type, file signature, and parseability against an allowlist. 4. Generate an internal identifier and store outside executable or public application paths. 5. Quarantine new files until malware, archive, and content-policy checks complete. 6. Transform images or documents to a safe canonical representation when the product permits it. 7. Serve downloads through an authorization check with safe disposition, type, and filename headers. 8. Record upload, scan, access, rejection, retention, and deletion events with minimal metadata. 9. Test polyglots, traversal names, duplicate names, malformed files, bombs, scanner outage, and cross-user access. 10. Provide a retry or appeal path for safe files rejected by uncertain inspection. ## Guardrails - Never trust a browser-provided filename or MIME type. - Do not expose quarantined storage through a predictable URL. - A malware scan does not replace type validation, authorization, or resource bounds. ## Done - An upload acceptance and retention policy is documented - Adversarial, outage, and cross-account tests are verified - Stored, quarantined, served, and deleted file records reconcile
在 GitHub 查看