diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-04 01:29:57 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-04 01:29:57 +0100 |
| commit | 4b2b4af606237def78273a42e881ae9f971cb505 (patch) | |
| tree | 47735062971b7dcddfbe3ad385ccbf2570fa6245 /src/commands/utilities.rs | |
| parent | docker: install ImageMagick for image compress/convert (diff) | |
| download | senator-sperma-4b2b4af606237def78273a42e881ae9f971cb505.tar.gz senator-sperma-4b2b4af606237def78273a42e881ae9f971cb505.zip | |
net: block private and link-local URLs
Diffstat (limited to '')
| -rw-r--r-- | src/commands/utilities.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/commands/utilities.rs b/src/commands/utilities.rs index c26fd0e..7a2e65d 100644 --- a/src/commands/utilities.rs +++ b/src/commands/utilities.rs | |||
| @@ -496,6 +496,11 @@ async fn run_download( | |||
| 496 | fformat: Option<&str>, | 496 | fformat: Option<&str>, |
| 497 | filename_user: Option<&str>, | 497 | filename_user: Option<&str>, |
| 498 | ) -> Result<()> { | 498 | ) -> Result<()> { |
| 499 | // Copyparty may legitimately live on localhost/LAN; every other host must | ||
| 500 | // be public. This blocks metadata endpoints and internal services. | ||
| 501 | if !ctx.data().copyparty.is_own_url(url) { | ||
| 502 | crate::net::ensure_public_http_url(url).await?; | ||
| 503 | } | ||
| 499 | let fmt = fformat.unwrap_or("mp4"); | 504 | let fmt = fformat.unwrap_or("mp4"); |
| 500 | let is_audio = matches!(fmt, "mp3" | "wav" | "m4a"); | 505 | let is_audio = matches!(fmt, "mp3" | "wav" | "m4a"); |
| 501 | let dl_dir = format!("{}/dl_{}", crate::config::TEMP_PATH, uuid::Uuid::new_v4()); | 506 | let dl_dir = format!("{}/dl_{}", crate::config::TEMP_PATH, uuid::Uuid::new_v4()); |
