Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
attempting to fix security flaw (issue #1)
- Loading branch information
1 parent
5736ec6
commit bc79575
Showing
2 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # -*- coding: utf-8 -*- | ||
|
|
||
| from __future__ import unicode_literals | ||
|
|
||
| import unittest | ||
| import yaml | ||
|
|
||
| from mlalchemy import * | ||
| from mlalchemy.testing import MLAlchemyTestCase | ||
|
|
||
|
|
||
| class TestYamlSecurity(MLAlchemyTestCase): | ||
|
|
||
| def test_basic_yaml_security(self): | ||
| with self.assertRaises(yaml.constructor.ConstructorError): | ||
| parse_yaml_query('!!python/object/apply:os.system ["echo Hello"]') | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| unittest.main() | ||
|
|