Currently dumpwallet and other RPCs can scribble all over the file system, at least as the user running bitcoind permits.
It would be better if these were at the least limited to the data directory, or even a specific directory within the data directory, say, ~/.bitcoin/dumpwallet—to avoid name collisions with wallets, lock files and database files. Overwriting is already prevented.