Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run_parts updates #707

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

run_parts updates #707

wants to merge 4 commits into from

Conversation

cgzones
Copy link
Contributor

@cgzones cgzones commented Apr 17, 2023

  • use shadow_logfd instead of stdout

    Similar to execution failure message.

  • run_part: drop void symlink check

    Since stat(2) is used the result can never be a symbolic link.

  • skip scripts with insecure ownership/permission

    Skip scripts that are either

    • not owned be the executing user or root,
    • not owned by the executing group or root,
    • world-writable.
  • use execveat(2) to avoid toctou issues

    Pin the script to execute before gathering its information to avoid any potential time-of-check-time-of-use issues.

Similar to execution failure message.
Since stat(2) is used the result can never be a symbolic link.
Skip scripts that are either
  - not owned be the executing user or root,
  - not owned by the executing group or root,
  - world-writable.
Pin the script to execute before gathering its information to avoid any
potential time-of-check-time-of-use issues.
int fd = openat (dfd, namelist[n]->d_name, O_PATH | O_CLOEXEC);
if (fd == -1) {
perror ("open");
for (; n<scanlist; n++) {

Check notice

Code scanning / CodeQL

For loop variable changed in body Note

Loop counters should not be modified in the body of the
loop
.
Sign up for free to 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.

None yet

1 participant