Struggling with the #Java Path API in

safePrefix(Path prefix, Path tail)

to resolve tail onto prefix or return null if the result is not a file **below** prefix. This shall prevent path traversal attacks. The code is ugly.

https://codeberg.org/harald/Codeschnipselnotizen/src/commit/c1c0fdc0463e02f93512f8f8b1b90509c5a82b45/java/de/haraldki/util/PathUtil.java

The tricky shit is in things like safePrefix("..", "..") where Path.normalize() does not what we might like it to do.

I would be happy about any code review I can get. (So boosts would be nice.)

#PathTraversal #path #security #codeReview

Codeschnipselnotizen/java/de/haraldki/util/PathUtil.java at c1c0fdc0463e02f93512f8f8b1b90509c5a82b45

Codeschnipselnotizen - Code snippets and notes

Codeberg.org

Messing for hours with #Java Path api. Safely do:
- given input path, possibly adversarial
- prefix it with a configured outPrefix
- ** make sure the result really points to a file/dir below outPrefix **

Consider a somewhat unluckily configured outPrefix = ".." and an adversarial path "../..". Path.of("../..").startsWith("..") is true. But startsWith() is what AI-coders and even stackoverflow suggest. 😱

FAIL.

https://stackoverflow.com/a/50731050/2954288

#pathTraversal #security #itsecurity #pathTraversalAttac

What's the right way in Java 8 to evaluate if /path/a is a subdirectory of /path?

Pretty much what the title asks. Say I'm passed a Path of "/tmp/foo/bar" and I want to specifically ensure that that path is a subdirectory of a path "/tmp", what is the most "Java 8"ish way of go...

Stack Overflow

How to Prevent File Upload Path Traversal

Two dots can escape any upload folder.

#php #uploads #pathtraversal #security #howto #filesystem

https://www.youtube.com/watch?v=Uett5oHrzjg

How to Prevent File Upload Path Traversal #security

YouTube
🚨 CVE-2026-25592 (CRITICAL, CVSS 10) impacts Microsoft Semantic Kernel <1.70.0: Remote path traversal in SessionsPythonPlugin enables arbitrary file writes. Upgrade to 1.70.0+ & validate file paths! https://radar.offseq.com/threat/cve-2026-25592-cwe-22-improper-limitation-of-a-pat-e2f967bb #OffSeq #PathTraversal #AIsecurity
WinRAR path traversal flaw still exploited by numerous hackers

Multiple threat actors, both state-sponsored and financially motivated, are exploiting the CVE-2025-8088 high-severity vulnerability in WinRAR for initial access and to deliver various malicious payloads.

BleepingComputer

Cybersecurity cert prep: Lab 10 (Path Traversal) — retrieve the list of users from the server

https://peertube.eqver.se/w/aGi7ffemEKnCwjfGHsJGYn

lt3ua_010_en

PeerTube

Cybersecurity cert prep: Lab 9 (Path Traversal) — build a vulnerable Flask server and test it with Burp Suite

https://peertube.eqver.se/w/6omQQ8hYKaeojLXLJTbXY3

lt3ua_009_en

PeerTube

Dziurawe cyfrowe ramki na zdjęcia – szereg poważnych luk bezpieczeństwa w popularnych urządzeniach

Doniesienia na temat problemów z bezpieczeństwem w świecie IoT znajdują się już w naszym stałym repertuarze, jednak opleceni coraz gęstszą siecią sprzętu zaliczanego do tej grupy często nie zdajemy sobie sprawy skąd czyhają kolejne zagrożenia. Tym razem pochylimy się nad raportem zespołu Quokka. Badacze wzięli na warsztat popularne cyfrowe ramki...

#Aktualności #Android #Awareness #Botnet #Chiny #Fotografie #Malware #Md5 #PathTraversal #Quokka #Ramki #Szpiegostwo #Uhale #Wyciek

https://sekurak.pl/dziurawe-cyfrowe-ramki-na-zdjecia-szereg-powaznych-luk-bezpieczenstwa-w-popularnych-urzadzeniach/

Dziurawe cyfrowe ramki na zdjęcia - szereg poważnych luk bezpieczeństwa w popularnych urządzeniach

Doniesienia na temat problemów z bezpieczeństwem w świecie IoT znajdują się już w naszym stałym repertuarze, jednak opleceni coraz gęstszą siecią sprzętu zaliczanego do tej grupy często nie zdajemy sobie sprawy skąd czyhają kolejne zagrożenia. Tym razem pochylimy się nad raportem zespołu Quokka. Badacze wzięli na warsztat popularne cyfrowe ramki...

Sekurak

Wybrane urządzenia Fortineta pod ostrzałem – atakujący wykorzystywali 0day

Zanim przejdziemy do konkretnego opisu  informacja dla administratorów:  podatne są następujące wersje  FortiWeb dla poszczególnych linii oprogramowania: Ponadto pojawiła się wreszcie oficjalna informacja od producenta (oraz identyfikator: CVE-2025-64446). Luka została wyceniona na 9.1 w skali CVSS 3.1 czyli krytyczna.   TLDR: Fortinet to firma, która bardzo często gości na naszych łamach....

#Aktualności #Cgi #Fortinet #PathTraversal #Rce #Websec

https://sekurak.pl/wybrane-urzadzenia-fortineta-pod-ostrzalem-atakujacy-wykorzystywali-0day/

Wybrane urządzenia Fortineta pod ostrzałem – atakujący wykorzystywali 0day

Zanim przejdziemy do konkretnego opisu  informacja dla administratorów:  podatne są następujące wersje  FortiWeb dla poszczególnych linii oprogramowania: Ponadto pojawiła się wreszcie oficjalna informacja od producenta (oraz identyfikator: CVE-2025-64446). Luka została wyceniona na 9.1 w skali CVSS 3.1 czyli krytyczna.   TLDR: Fortinet to firma, która bardzo często gości na naszych łamach....

Sekurak
āš ļø CVE-2025-13161 (HIGH): IQ-Support 1.0 has a path traversal vuln—unauthenticated attackers can read arbitrary files. No patch yet. Restrict access & monitor for abuse! Details: https://radar.offseq.com/threat/cve-2025-13161-cwe-23-relative-path-traversal-in-i-52498e53 #OffSeq #Vuln #Infosec #PathTraversal