Skip to content

fix(sign): sign the raw path - #2258

Merged
xhofe merged 1 commit into
AlistGo:mainfrom
koho:fix-sign
Nov 11, 2022
Merged

fix(sign): sign the raw path#2258
xhofe merged 1 commit into
AlistGo:mainfrom
koho:fix-sign

Conversation

@koho

@koho koho commented Nov 8, 2022

Copy link
Copy Markdown
Contributor

For now, we only sign the filename and timestamp to generate a download link. But this may cause a security problem that someone can bypass authentication to access file in other protected storage.

For example, we have two local storages protected with different password:

  • /s1
    • f1.txt
  • /s2
    • f1.txt

The two files that have the same names (content may differ) but in different storages. Let /s1 be the root directory of user u1 and copy the download link of f1.txt. The link is working with a suffix /d/s1/f1.txt?sign=xxxxx. Now we change s1 to s2 in the link, the file f1.txt in s2 is successfully downloaded.

If we sign the whole file path, we can identify this path hack as invalid signature.

@welcome

welcome Bot commented Nov 8, 2022

Copy link
Copy Markdown

Thanks for opening this pull request! Please check out our contributing guidelines.

@xhofe
xhofe merged commit 00de9bf into AlistGo:main Nov 11, 2022
@welcome

welcome Bot commented Nov 11, 2022

Copy link
Copy Markdown

Congrats on merging your first pull request! We here at behavior bot are proud of you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants