Ecosyste.ms: OpenCollective

An open API service for software projects hosted on Open Collective.

github.com/sudo-project/sudo

Utility to execute a command as another user
https://github.com/sudo-project/sudo

Detect integer overflow when converting JSON_ARRAY to string vector.

Extremely unlikely to happen but better safe than sorry.

92cf172edad0f068364e08c262d4c2ea46ed210d authored over 3 years ago by Todd C. Miller <[email protected]>
Only strip double quotes from an include path if len >= 2.

Found locally using libfuzzer/oss-fuzz.

665f8d2e3e52c3260bfc682044843a4183ecc210 authored over 3 years ago by Todd C. Miller <[email protected]>
Don't allow the sudoers fuzzer to open include files.

If we allow the fuzzer to choose include paths it will include
random files in the file system. ...

e675f4c078bb5041fff7589776d8db6e494359e9 authored over 3 years ago by Todd C. Miller <[email protected]>
If getdelim() returns a string with embedded NULs, truncate on first one.

This should avoid some issues with the fuzzer.

f5fc5d64170f51a864fe891cb3520ec54dcaf3d5 authored over 3 years ago by Todd C. Miller <[email protected]>
Reallocate the buffer correctly when appending a newline.

Fixes a potential buffer overflow introduced in the last commit.

10e37223b5cc780a7862ae3f6c7834b56e93211c authored over 3 years ago by Todd C. Miller <[email protected]>
Don't free the alias name in alias_add() if the alias already exists.

We need to be able to display it using alias_error().
Only free what we actually allocated in ali...

b4cabdb39455c8adfed02f269502766cbfdd3ee1 authored over 3 years ago by Todd C. Miller <[email protected]>
Fix NUL termination when parsing a sudoers file with no ending newline.

oss-fuzz issue #30252

884b2fb86b3089f900cfd6d0379bf8629d2fc5be authored over 3 years ago by Todd C. Miller <[email protected]>
sudoersrestart() does not reset state to INITIAL, do it in init_lexer().

Fixes spurious errors from fuzz_sudoers, which calls the parser multiple times.

077c9b0c745f3bf67da01d98252ede6635fea485 authored over 3 years ago by Todd C. Miller <[email protected]>
Push lexer leak tracking down into check_fill.c.

This lets us track things correctly when buffers are realloc()d.
Rewrote fill() and append() to b...

63a63680b664737ae99314c1ebc5e8f2075440b7 authored over 3 years ago by Todd C. Miller <[email protected]>
Use sudoersrestart() in fuzz_sudoers.c

Since we run the parser multiple times we need to restart it each time.

3237a18ee3feae91346933c6eb6ca92dad08e1c6 authored over 3 years ago by Todd C. Miller <[email protected]>
Parser needs user_shost for the %h escape in @include expansion.

Fixes oss-fuzz issue #30238

e66b132d7674778105b6c98153470631aaad773c authored over 3 years ago by Todd C. Miller <[email protected]>
The --disable-leaks option is not recommended for production use.

bde441186726e3a3a311b16b16534e69625bb6ca authored over 3 years ago by Todd C. Miller <[email protected]>
Remove options from the leak list before freeing them.

Should fix oss-fuzz issue #30236

bd4e8bc699ba1355c5579f345b4521017b8454f1 authored over 3 years ago by Todd C. Miller <[email protected]>
Add fuzzer for legacy I/O log info file.

d2901f4121e5490f9d1128458a8e229f4870b3cd authored over 3 years ago by Todd C. Miller <[email protected]>
Fix uninstall target; there were missing line continuation chars.

GitHub issue #87

29f5f3c53ecf92c53151dde2b607bc7d2f4b31ea authored over 3 years ago by Todd C. Miller <[email protected]>
Don't close fp in sudoers_parse_ldif()

The caller should be the one to handle this.

aaa2e8ddecf85903d71146532e40a14ea952ca2e authored over 3 years ago by Todd C. Miller <[email protected]>
Update ignore files.

68939adee2f17d6f3338b9bc7985bf479bd072d7 authored over 3 years ago by Todd C. Miller <[email protected]>
Got back to calling alias_free() on alias_add() failure.

We now need to remove the name and members from the leak list
*before* calling alias_add() since ...

bdb02b1eff21d8281fc6e686a1ad0fd37ad49a9b authored over 3 years ago by Todd C. Miller <[email protected]>
close sudoersin, not fp, and reset it to be safe

8f2254594f09c53f4d469f28cc50deb57e4f0c82 authored over 3 years ago by Todd C. Miller <[email protected]>
Add missing fclose(3) of fmemopen(3) stream; it does not modify the data.

20b3904f4f7e0b6199b783d6155b84d11b1dbbcd authored over 3 years ago by Todd C. Miller <[email protected]>
Check for unexpected value after checking the name, not before.

2fd4a2ad710bce6aa467f3ff1c738b98b095fd17 authored over 3 years ago by Todd C. Miller <[email protected]>
Allow getprogname() to succeed as long as __progname is present.

Also simplify the progname code so we only need a single implementation.

eec4f42366aa5967a2850879a3fa55590022d4db authored over 3 years ago by Todd C. Miller <[email protected]>
Fix potential leak of evlog->runuser.

Also warn if we find an unexpected JSON type.

71997da168ec173f4cf367f2e13bc25c6bf8fe02 authored over 3 years ago by Todd C. Miller <[email protected]>
Parse into a local parse_tree and add missing cleanup.

Since parsed_policy is for the sudoers parser we should declare our own.

0d34fa4285ba3e8375e84e2adff3381fbefcda0d authored over 3 years ago by Todd C. Miller <[email protected]>
Call init_parser() after parsing to clean up completely.

d3735b98e9f45db697eb85ed8b847acbcd076ef8 authored over 3 years ago by Todd C. Miller <[email protected]>
Plug a few more parser leaks.

f30670a42f3a7b80a7ce8e876a58d008e5a30542 authored over 3 years ago by Todd C. Miller <[email protected]>
Make parser_leak_remove(type, NULL) a no-op.

f59a8f30359c7884db0dfe154598b0efb331f638 authored over 3 years ago by Todd C. Miller <[email protected]>
Add initial fuzzers to be used by oss-fuzz.

These are not yet hooked up to the sudo build.

1e3cecc60831ed9b2c817c6f96bbf653f1a91dd5 authored over 3 years ago by Todd C. Miller <[email protected]>
Garbage collect unused gc_remove() function.

a74e8502c0452b720c143a2856848930bbe3f109 authored over 3 years ago by Todd C. Miller <[email protected]>
The parser should be leak free, re-enable leak detection in ASAN.

66cd61a9bdbb0e8dabaa56dab1809241a130fd04 authored over 3 years ago by Todd C. Miller <[email protected]>
Add garbage collection to the sudoers parser to clean up on error.

This makes it possible to avoid memory leaks when there is a parse error.

9ed14870c69e1ae711f2848d849828dded14f108 authored over 3 years ago by Todd C. Miller <[email protected]>
Move new_member_all to ldap_util.c, it is only used by ldap/sssd.

568931035dbb65fc57bafe9f0222d85107c2cd7f authored over 3 years ago by Todd C. Miller <[email protected]>
Fix crashes trying to parse invalid JSON.

Found locally using libfuzzer/oss-fuzz.

4cd6350cadff4dd59f455f8c3a243e211edf4947 authored over 3 years ago by Todd C. Miller <[email protected]>
Plug memory leak if a key is listed more than once in the log.json file.

de82d08e70aabcd1f4dea234f82d1eeabdb0c42f authored over 3 years ago by Todd C. Miller <[email protected]>
Fix crash when file does not exist.

5dc297d300c44efe2e19f1adf336f7873c2abc25 authored over 3 years ago by Todd C. Miller <[email protected]>
Strict tz offset parsing.

Fixes an out of bounds read found locally using libfuzzer/oss-fuzz.

439660c7fb02c17f43497fab3fa04bd59fe7ac53 authored over 3 years ago by Todd C. Miller <[email protected]>
Don't leak memory for duplicate command options.

The last option wins but we also now warn about the duplicate.
Found locally using libfuzzer/oss-...

9f81e8a10941168b88b4855a2bc753c6f5919f9d authored over 3 years ago by Todd C. Miller <[email protected]>
Copy command options when converting a sudoRole with multiple sudoCommands.

A sudoRole with multiple sudoCommands is converted to a privilege
with multiple cmndspecs. Howev...

4eb591c6f3e0374c5259e56c4f8c26257d20fbdf authored over 3 years ago by Todd C. Miller <[email protected]>
Fix memory leak if the last line is folded.

Fixes issue 30080 by ClusterFuzz-External

75f76eba819b9b8b19924f1427220db1532c1181 authored over 3 years ago by Todd C. Miller <[email protected]>
Add --disable-leaks configure option.

This enables the extra freeing of memory before exit also enabled
by --enable-asan. To be used b...

bd10bb5cfeb605cbf31b77b51407327ddee3765e authored over 3 years ago by Todd C. Miller <[email protected]>
Stricter parsing of generalized time.

Fixes potential out of bounds read found by libfuzzer/oss-fuzz.

995601c621b5f6d1e57bccf267308b37b0d7ad49 authored over 3 years ago by Todd C. Miller <[email protected]>
Don't bother calling ldif_to_sudoers() if there are no roles to convert.

419c8952402b5b5642a0d093aa713819f26a36e3 authored over 3 years ago by Todd C. Miller <[email protected]>
In json_stack_push() treat stack exhaustion like memory allocation failure.

Return NULL instead of treating as a fatal error.
This should make life a little easier for oss-f...

8781560e1bf30e2b7fa564865d138f663bbfa125 authored over 3 years ago by Todd C. Miller <[email protected]>
Update comment about return values for resolve_host().

6c8242c3579efcf885a4f8ec726cd327cc051e08 authored over 3 years ago by Todd C. Miller <[email protected]>
Fix NO_ROOT_MAILER, broken by the eventlog refactor in sudo 1.9.4.

init_eventlog_config() is called immediately after initializing the
Defaults settings, which is b...

e5ad88488d57dd30a7f08f46b395bccfd3957293 authored over 3 years ago by Todd C. Miller <[email protected]>
Add plugins/sudoers/strvec_join.c

8f114c2aaec50ef8973c8180e69882a6275f752f authored over 3 years ago by Todd C. Miller <[email protected]>
Fix compilation on systems without a native strlcpy() function.

8ca47cc99d47214cdb4f583a14771fce5e3a9c1e authored over 3 years ago by Todd C. Miller <[email protected]>
Break up the long help string into multiple printf() statements.

AIX xlc compiler doesn't like cpp directives in between strings.
Also fixes a complaint from cppc...

dceab7d756ebcad8e6d2e9f6a4b3937e827abc25 authored over 3 years ago by Todd C. Miller <[email protected]>
strvec_join: free result on error and actually use separator char

c9eff93854f53fdc8f57744c7f069388b6753393 authored over 3 years ago by Todd C. Miller <[email protected]>
Test strvec_join() using strlcpy_unesc().

Emulates an overflow like: sudoedit -s '\' `perl -e 'print "A" x 65536'`

888f63a9c8b4a848d1049871c05ce3656c015ffc authored over 3 years ago by Todd C. Miller <[email protected]>
Refactor code to flatten an argument vector into a string.

This is used when building up the user_args string.

29acc6419270d4dc8413c18517e089b4d2dc6907 authored over 3 years ago by Todd C. Miller <[email protected]>
Add strlcpy_unescape() function to undo escaping from front-end.

Includes unit test.

2804c2c78e7007c6e718754efb739b7fa8831f0c authored over 3 years ago by Todd C. Miller <[email protected]>
Add missing check for reallocarray() failure.

Found by OSS-Fuzz.

aa50aaf8dae9c3c5e6c27ee743cedec1b0524fba authored over 3 years ago by Todd C. Miller <[email protected]>
Remove Py_SSIZE2SIZE to quiet cppcheck warnings.

Tuple size cannot be negative and we already handle the case where
it is zero.

bca213959b8af65f74a4eac7ffa5973a645c7bc2 authored over 3 years ago by Todd C. Miller <[email protected]>
The program name may now only be "sudo" or "sudoedit".

We no longer need to check for any string that ends in "edit".

19d5845f8b6ae429a597d53c7f8201514537b590 authored over 3 years ago by Todd C. Miller <[email protected]>
Fix the memset offset when converting a v1 timestamp to TS_LOCKEXCL.

We want to zero the struct starting at flags, not type (which was just set).
Found by Qualys.

0754533d2445c93a380c362a185b5464c417455e authored over 3 years ago by Todd C. Miller <[email protected]>
Sudo 1.9.5p2

98d5cc2a856c8fcd68e5066b8a7523a795eaaac2 authored over 3 years ago by Todd C. Miller <[email protected]>
Don't assume that argv is allocated as a single flat buffer.

While this is how the kernel behaves it is not a portable assumption.
The assumption may also be ...

c0eecf85c8b0920a9398920d5f5dae0ee2804b46 authored over 3 years ago by Todd C. Miller <[email protected]>
Fix potential buffer overflow when unescaping backslashes in user_args.

Also, do not try to unescaping backslashes unless in run mode *and*
we are running the command vi...

1f8638577d0c80a4ff864a2aad80a0d95488e9a8 authored over 3 years ago by Todd C. Miller <[email protected]>
Reset valid_flags to MODE_NONINTERACTIVE for sudoedit.

This is consistent with how the -e option is handled.
Also reject -H and -P flags for sudoedit as...

b301b46b79c6e2a76d530fa36d05992e74952ee8 authored over 3 years ago by Todd C. Miller <[email protected]>
Add sudoedit flag checks in plugin that are consistent with front-end.

Don't assume the sudo front-end is sending reasonable mode flags.
These checks need to be kept co...

c4d384082fdbc8406cf19e08d05db4cded920a55 authored over 3 years ago by Todd C. Miller <[email protected]>
pam: pass KRB5CCNAME to pam_authenticate environment if available

If a PAM module wants to authenticate user using GSSAPI, the authentication
is broken if non-def...

3b7977a42c0d5a094e7328a0d4a910ee14633e45 authored over 3 years ago by Pavel Březina <[email protected]>
lib/eventlog/Makefile.in: fix static build without closefrom

Since version 1.9.4 and
https://github.com/sudo-project/sudo/commit/bd1ca79cca827a92e904f022e49d...

c05fe93669e60dba1e290d448254503bd84c8ca3 authored over 3 years ago by Fabrice Fontaine <[email protected]>
Do not add an unfinished write buffer to the queue if it is already present.

In client_msg_cb() we only remove a buffer from the queue when it is
finished. Inserting the buf...

376ad5e6b481e7469088a200b36a20ecc6c5ab85 authored over 3 years ago by Todd C. Miller <[email protected]>
Fix problem when SSL_read() returns SSL_ERROR_WANT_WRITE. This can

happen when the socket cannot be written to immediately.
We need to set the read_instead_of_write...

eb536d8b7c436089eab19c66e724f8b769dd644a authored over 3 years ago by Todd C. Miller <[email protected]>
Fix setprogname() emulation on systems without it.

For fully-qualified paths, store the string starting after the last slash,
not at the slash itself.

d98dd5f98d6b7313fb3509740f53776f1f2493d2 authored almost 4 years ago by Todd C. Miller <[email protected]>
Sudo 1.9.5p1

e60ff9058b65f12652847316ec81954b4bce7bbe authored almost 4 years ago by Todd C. Miller <[email protected]>
Run the editor with the user's real and effective uid and gid.

Fixes a bug introduced in sudo 1.9.5 where the editor was run setuid
root unless SELinux RBAC was...

3a13f1bf0cf34b59b436476c5c685204d25b0fda authored almost 4 years ago by Todd C. Miller <[email protected]>
fix typo

ea150d5918d7250f485b944a8ff77ac428e0865e authored almost 4 years ago by Todd C. Miller <[email protected]>
Add casts to quiet two warnings on Solaris.

01d0bbfb8555a15ace944138fa69a6c1a516ce15 authored almost 4 years ago by Todd C. Miller <[email protected]>
Update .pot files for 1.9.5.

250cccfe4ca2a15ae106adc7884db2742648794d authored almost 4 years ago by Todd C. Miller <[email protected]>
Sudo 1.9.5

9e111eae57524ca72002ad1db36eb68ccd50b167 authored almost 4 years ago by Todd C. Miller <[email protected]>
Allow SELinux support to be disabled via the sudoers file.

Defaults to true if sudo is built with SELinux support and SELinux
is not disabled on the system.

1b72d6a5cc636dd2bf4ca2ba8f97adf57f7e3e47 authored almost 4 years ago by Todd C. Miller <[email protected]>
Add a comment to verify_import() to clarify its purpose.

4603da02afad0969937bc1c2b3a53821c41aff12 authored almost 4 years ago by Todd C. Miller <[email protected]>
Suppress PVS Studio false positives.

4e11bc0e26b76dfd885d968b925688ec1880c734 authored almost 4 years ago by Todd C. Miller <[email protected]>
Plug a memory leak in sudoerserrorf().

108e29446d36b6ed044e5c1f3dcf0cccb8500bb7 authored almost 4 years ago by Todd C. Miller <[email protected]>
Quiet a few harmless cppcheck warnings.

92c88d4105f00809b462a8d8bcd77a854c9b077a authored almost 4 years ago by Todd C. Miller <[email protected]>
Add struct sudo_cred to hold the invoking or runas user credentials.

We can use this when we need to pass around credential info instead
of the user_details and comma...

ece5adc6626d698f4fcbd7f08a361f2c19153ae4 authored almost 4 years ago by Todd C. Miller <[email protected]>
In sudoedit, use sudo_check_temp_file() for non-SELinux too.

397a07e86f5e2ccfe046f4c76aff8d21b1980b24 authored almost 4 years ago by Todd C. Miller <[email protected]>
Move safe open code out of sudo_edit.c and into edit_open.c.

a5be62c68fca656beab7e68590d817154cbf6a4c authored almost 4 years ago by Todd C. Miller <[email protected]>
Remove the --force option from the cppcheck args, it causes errors.

84b3a1dae1b4f0a04a7cbd950309b4a98f6a9cca authored almost 4 years ago by Todd C. Miller <[email protected]>
Split up sesh_sudoedit() so it is organized more like sudo_edit.c.

The new sesh_edit_create_tfiles() and sesh_edit_copy_tfiles() functions
are analogous to sudo_edi...

83ff1646907e46d97630c5186a16d670352ef681 authored almost 4 years ago by Todd C. Miller <[email protected]>
Add setprogname(3) for those without it.

9e068c15e07cfe3a915dd4e71aa3e4be90be4306 authored almost 4 years ago by Todd C. Miller <[email protected]>
Rename run_cred -> cur_cred and stash existing creds in set_tmpdir().

For sudo_edit_open() et al what we need is a copy of the current
cred to restore after dir_is_wri...

7788581473283e6c1e381562f39dfbbf9cf6fd1c authored almost 4 years ago by Todd C. Miller <[email protected]>
Add directory writability checks for SELinux RBAC sudoedit.

These were never added to the SELinux RBAC path.

46e2d7290a0df7b7257e8489181ade5095e9cae5 authored almost 4 years ago by Todd C. Miller <[email protected]>
For sudo, only allow "sudo" or "sudoedit" as the program name.

The program name is also used when matching Debug lines in sudo.conf.
We don't want the user to b...

b132def0b19c018ed23093d40d1471b6f2d47e28 authored almost 4 years ago by Todd C. Miller <[email protected]>
Add security checks before using temp files for SELinux RBAC sudoedit.

Otherwise, it may be possible for the user running sudoedit to
replace the newly-created temporar...

7cd36222e765d8fc561e5a52a59a1c3a4feb38bb authored almost 4 years ago by Todd C. Miller <[email protected]>
Fix potential directory existing info leak in sudoedit.

When creating a new file, sudoedit checks to make sure the parent
directory exists so it can prov...

db1f27c0350e9e437c93780ffe88648ae1984467 authored almost 4 years ago by Todd C. Miller <[email protected]>
Check the return value of fcntl() when setting FD_CLOEXEC.

This should never fail unless the fd is invalid.
Problem reported by Matthias Gerstner of SUSE.

71339c574fdc5f641e91d4a2acba2c89367e9087 authored almost 4 years ago by Todd C. Miller <[email protected]>
Updated translations from translationproject.org

295f099cfcdf14d44e5e14c1be36fb1da4c10dbf authored almost 4 years ago by Todd C. Miller <[email protected]>
Use debug_return_int() not debug_return_bool() to return -1.

Found by PVS Studio.

741cf082a358120dcbbe1005bd794bad157e4e10 authored almost 4 years ago by Todd C. Miller <[email protected]>
Fix a crash introduced in 1.9.4 when running "sudo -i" as an unknown user.

4ea6f73060c6b7c7fc24fbff78fc4c89a828e30f authored almost 4 years ago by Todd C. Miller <[email protected]>
Make sure lecture file is a regular file before reading it.

7f34b8bbbd1609b160ad0aeac836f169216c7e25 authored almost 4 years ago by Todd C. Miller <[email protected]>
Remove #ifdefs around code using pread(3) and pwrite(3).

6e1986e91577f4ec3b8dc1787becda86d7f1ed36 authored almost 4 years ago by Todd C. Miller <[email protected]>
Add emulation of pread(3) and pwrite(3) for systems without them.

This makes it possible to remove some ugly #ifdefs and only affects
very old systems.

06bfbecd64e91153662c02731e7cef9e5a80621d authored almost 4 years ago by Todd C. Miller <[email protected]>
Cannot do direct exec of a command when SELinux RBAC is enabled.

267b9a8a237f32fe291967bafe70f7c82f194d45 authored almost 4 years ago by Todd C. Miller <[email protected]>
Avoid potential use after free with eventlog-only connections.

Coverity CID 215884.

f6452c7caf9261d8cef476e8ced22b5e57e3bcd3 authored almost 4 years ago by Todd C. Miller <[email protected]>
Minor fixes pointed out by cppcheck.

Also add compareBoolExpressionWithInt to suppression list.

86178333853296e12b7ecfff748a28667f269150 authored almost 4 years ago by Todd C. Miller <[email protected]>
Regen now that ldap.c and sssd.c no longer need gram.h

8ea19e294ba30268c9b0878fd30c9050cae4da47 authored almost 4 years ago by Todd C. Miller <[email protected]>
Fix deregistration of a callback that is not at the head of the list.

The SLIST_FOREACH_PREVPTR macro doesn't work the way I thought it did.
Just store our own prev po...

9547755c3fa7c47ac1546868bfae6be33a30ebac authored almost 4 years ago by Todd C. Miller <[email protected]>