Skip to content

Instantly share code, notes, and snippets.

@wisq
Created September 25, 2014 23:05
Show Gist options
  • Save wisq/41f1c65f0950b2a2342b to your computer and use it in GitHub Desktop.
Save wisq/41f1c65f0950b2a2342b to your computer and use it in GitHub Desktop.
My solution to the bash exploit
diff -ruN a/bash/shell.c b/bash/shell.c
--- a/bash/shell.c 2011-01-02 21:04:51.000000000 +0000
+++ b/bash/shell.c 2014-09-25 21:20:24.656725026 +0000
@@ -1703,13 +1703,8 @@
tilde_initialize ();
/* Initialize internal and environment variables. Don't import shell
- functions from the environment if we are running in privileged or
- restricted mode or if the shell is running setuid. */
-#if defined (RESTRICTED_SHELL)
- initialize_shell_variables (shell_environment, privileged_mode||restricted||running_setuid);
-#else
- initialize_shell_variables (shell_environment, privileged_mode||running_setuid);
-#endif
+ functions from the environment, period. What a terrible idea. */
+ initialize_shell_variables (shell_environment, 1);
/* Initialize the data structures for storing and running jobs. */
initialize_job_control (0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment