Skip to content

Commit

Permalink
security: disable python-evaluated input by default
Browse files Browse the repository at this point in the history
As described in issue overhangio#284, tutor does not come with codejail enabled out of
the box. Actually, we don't even have a working plugin, yet. To prevent users
from running unsafe code, we explicitely disable python-evaluated input by
disabling the "python" interpreter. This might break some courses; thus, this
is a non-backward compatible change.
  • Loading branch information
regisb committed Jun 6, 2021
1 parent 58c77ad commit a79d194
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Note: Breaking changes between versions are indicated by "💥".

## Unreleased

- [Bugfix] Fix discussion notification not work.
- 💥[Security] Disable python-evaluated input by default as we don't run codejail.
- [Bugfix] Fix missing discussion notifications.
- [Improvement] Better error logging when loading a plugin from an incompatible version.

## v11.2.11 (2021-05-18)
Expand Down
10 changes: 10 additions & 0 deletions tutor/templates/apps/openedx/settings/partials/common_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,15 @@
}
]

# Disable codejail support
# explicitely configuring python is necessary to prevent unsafe calls
import codejail.jail_code
codejail.jail_code.configure("python", "nonexistingpythonbinary", user=None)
# another configuration entry is required to override prod/dev settings
CODE_JAIL = {
"python_bin": "nonexistingpythonbinary",
"user": None,
}

{{ patch("openedx-common-settings") }}
######## End of settings common to LMS and CMS

0 comments on commit a79d194

Please sign in to comment.