Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

bug(stat): Parser Edge Cases (--format option) (Fuzzing Part 1)

Closed
#15,348 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@Franklin-Qi is already working on this.

Since Oct 16, 2026.

  • #15352 by @ozenyunus35 — closed without merging
  • #15411 by @Franklin-Qi — open

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
22/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
cli

Research direction

Start by reproducing the stat --format cases in the issue against the built binary and comparing them with GNU stat's invalid directive errors. Pull request #15352 is already open against this issue, so read it first to see what it covers. Done means the malformed directives in the report fail with an invalid-directive error like GNU's, and the reproduction cases match GNU output.

Written by the indexing model from the issue text.

Description

U - stat

Hi, uutils mainteners, i hope everything good

we fuzzed the stat parser for edge cases via manual fuzzing ourselves and we discovered as for now one edge case

relunsec@relunsec:~/software/coreutils/target/debug$ ./stat --format='%++-+%1212x' /
?1212x
relunsec@relunsec:~/software/coreutils/target/debug$ gnustat --format='%++-+%1212x' /
gnustat: ‘%++-+%’: invalid directive
relunsec@relunsec:~/software/coreutils/target/debug$ 

same for

relunsec@relunsec:~/software/coreutils/target/debug$ ./stat --format=$'%++-+-s%1212x' / 
+28                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         2026-10-14 04:31:58.902392402 -0400
relunsec@relunsec:~/software/coreutils/target/debug$ gnustat --format=$'%++-+-s%1212x' / 
28                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         2026-10-14 04:31:58.902392402 -0400
relunsec@relunsec:~/software/coreutils/target/debug$ 

also we discovered

relunsec@relunsec:~/software/coreutils/target/debug$ ./stat --format=$'%+-%%ss%1212x' / 
?28s                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         2026-10-14 04:31:58.902392402 -0400
relunsec@relunsec:~/software/coreutils/target/debug$ gnustat --format=$'%+-%%ss%1212x' / 
gnustat: ‘%+-%’: invalid directive
relunsec@relunsec:~/software/coreutils/target/debug$ 

can be with just

same as

relunsec@relunsec:~/software/coreutils/target/debug$ ./stat --format=$'%s%0%%' / 
28?%
relunsec@relunsec:~/software/coreutils/target/debug$ gnustat --format=$'%s%0%%' / 
28gnustat: ‘%0%’: invalid directive
relunsec@relunsec:~/software/coreutils/target/debug$ 
relunsec@relunsec:~/software/coreutils/target/debug$ ./stat --format=$'%-%s1212x' / 
?s1212x
relunsec@relunsec:~/software/coreutils/target/debug$ gnustat --format=$'%-%s1212x' / 
gnustat: ‘%-%’: invalid directive
relunsec@relunsec:~/software/coreutils/target/debug$ 

reproduces this issue
seems similar as below but with different input

same as

relunsec@relunsec:~/software/coreutils/target/debug$ ./stat --format '%#%d' --file-system /
?d
relunsec@relunsec:~/software/coreutils/target/debug$ gnustat --format '%#%d' --file-system /
gnustat: ‘%#%’: invalid directive

as i see gnu errors out, uutils no for invalid directive

and then same for

relunsec@relunsec:~/software/coreutils/target/debug$ ./stat --format '%s%#%#b' --file-system /
131072?#b
relunsec@relunsec:~/software/coreutils/target/debug$ gnustat --format '%s%#%#b' --file-system /
131072gnustat: ‘%#%’: invalid directive
relunsec@relunsec:~/software/coreutils/target/debug$ 
Dominant language
Rust
Stars
24.3k
Forks
2.1k
Avg merge
1d 16h
Merged PRs (30d)
310

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from uutils/coreutils

All issues in uutils/coreutils

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.