[26.05] rapidraw: fix CVE-2026-64816 (#547877)

This commit is contained in:
Thomas Gerbet
2026-08-01 12:40:53 +00:00
committed by GitHub
2 changed files with 37 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
diff --git a/src-tauri/src/lut_processing.rs b/src-tauri/src/lut_processing.rs
index 5bfbb5b9..51db4bab 100644
--- a/src-tauri/src/lut_processing.rs
+++ b/src-tauri/src/lut_processing.rs
@@ -187,6 +187,26 @@ fn parse_hald(image: DynamicImage) -> Result<Lut> {
}
pub fn parse_lut_file(path_str: &str) -> Result<Lut> {
+ if path_str.starts_with(r"\\") || path_str.starts_with("//") {
+ return Err(anyhow!("Network paths (UNC) are not allowed for LUTs"));
+ }
+
+ if path_str.contains("..") {
+ return Err(anyhow!("Directory traversal (..) is not allowed"));
+ }
+
+ let path = std::path::Path::new(path_str);
+ if let Some(std::path::Component::Prefix(prefix)) = path.components().next() {
+ match prefix.kind() {
+ std::path::Prefix::UNC(_, _)
+ | std::path::Prefix::VerbatimUNC(_, _)
+ | std::path::Prefix::DeviceNS(_) => {
+ return Err(anyhow!("Device/UNC prefix paths are not allowed"));
+ }
+ _ => {}
+ }
+ }
+
let (extension, bytes): (String, Option<Vec<u8>>) =
if cfg!(target_os = "android") && is_android_content_uri(path_str) {
#[cfg(target_os = "android")]

View File

@@ -58,6 +58,11 @@ rustPlatform.buildRustPackage (finalAttrs: {
hash = "sha256-JtkzeCt21KIEshvoCHWo1QoxUgvVJN1loJrUHgvV4qE=";
};
patches = [
# Patch CVE-2026-64816
./fix-cve-2026-64816.patch
];
nativeBuildInputs = [
pkg-config
makeWrapper