Skip to content

create the resumable index store with owner-only permissions - #2281

Merged
hyperxpro merged 1 commit into
AsyncHttpClient:mainfrom
madib06ops:resumable-store-perms
Jul 24, 2026
Merged

create the resumable index store with owner-only permissions#2281
hyperxpro merged 1 commit into
AsyncHttpClient:mainfrom
madib06ops:resumable-store-perms

Conversation

@madib06ops

Copy link
Copy Markdown
Contributor

PropertiesBasedResumableProcessor.save() writes the download index to the fixed path $java.io.tmpdir/ahc/ResumableAsyncHandler.properties, creating the directory with mkdirs() and the file with createNewFile(), so both land with umask-default permissions in the shared temp directory and the write follows whatever is at that path. On a multi-user host any local user can then read the URLs being downloaded (userinfo and query tokens included), or plant a symlink at that predictable path before the shutdown hook fires and have the client truncate the file it points to; load() followed the same symlink on the way back in, so a planted file also feeds forged resume offsets to the handler. The store is now created 0700/0600 and reopened with CREATE_NEW after a delete, so a raced re-plant fails the open instead of being written through, and load() reads with NOFOLLOW_LINKS. Both checks live in the processor because it owns the path, and the new test fails on the current code with rw-r--r-- and with the symlink target overwritten.

@hyperxpro
hyperxpro merged commit d945ce3 into AsyncHttpClient:mainJul 24, 2026
25 of 26 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@madib06ops@hyperxpro