DeepFrontend
Learning Paths
Practice
System Design & DS
Design Studio
Data Structures Curriculum
Real-World Case Studies
Careers
Job Board
Resume Builder
Blog
Sign in
Search
⌘K
Go Pro
Loading compiler resources...
Node.js Quiz Practice
Active Recall Drill Session
← Exit Session
Question 1 of 1
medium
Node.js
What's the recommended fix for a path-traversal-vulnerable file-serving endpoint?
A
Remove path.join() entirely
B
Resolve the final path and explicitly verify it's still within the intended base directory before serving it
C
Trust all filenames since they come from authenticated users
D
Switch to a different file system
Check Answer