apache / apache/mina-sshd

sftp subsystem ignores process umask when creating directory

Open
#535 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.1k
Forks
400
Avg merge
5d 1h
Merged PRs (30d)
1

Description

### Version

2.12.0

### Bug description

Connect to mina sshd sftp server using normal sftp client. Use "mkdir" to create a directory. The directory is created with mode 777 (rwxrwxrwx). The process umask (0022 or 0027) should prevent "write by others" being set.

The directory is created with the correct mode then this is overridden in doMakeDirectory

### Actual behavior

The directory is created with mode 777 (rwxrwxrwx).

### Expected behavior

he directory is created without write by others permission.

### Relevant log output

_No response_

### Other information

_No response_

Contributor guide

No contributing guide indexed for this repository

Research direction

The report points to doMakeDirectory as the place where the directory mode is overridden. Start there and inspect how the SFTP subsystem creates directories and applies process umask handling. Done means an SFTP mkdir no longer grants write permission to others when the umask is 0022 or 0027, with the relevant existing SFTP tests run or extended.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.