fix: harden share expiry, download token, quota SQL, and CORS#496
Merged
Conversation
Apply the useful security fixes from PR #494 with review corrections: validate expire_style through a shared helper, accept previous download token window, detect SQL dialect via Tortoise capabilities, close remote download sessions on client abort, and disable invalid CORS credentials.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Owner
Author
|
关联说明:本 PR 基于 @lichangfeng-1 在 #494 中提出的安全修复方向,在 code review 后落地了增强版实现。 主要差异:
如果 #494 作者愿意,也欢迎把上述修正回灌到原 PR;当前仓库以本 PR 作为可合入版本继续推进。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
基于 #494 的安全修复思路,在 review 后落地增强版补丁。
Related: #494
expire_style白名单校验(share_text/share_file/complete_upload/presign_upload_init)capabilities.dialect适配(修复原 PR 中conn.engine无效探测)allow_credentials=True(与allow_origins=["*"]冲突)相对 #494 的改进
capabilities.dialect+db_config.engine回退validate_expire_style(),避免继续漏检tests/test_pr494_security_patches.pyTest plan
python3 -m pytest tests/test_pr494_security_patches.py tests/test_issue_486_storage_quota.py tests/test_issue_482_share_usage.py -qforever后文本分享/分片完成被拒绝