Giter Club home page Giter Club logo

owasp-pysec's People

Contributors

ebranca avatar hephex avatar rvelea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

owasp-pysec's Issues

Workaround for pickle load

https://github.com/ebranca/owasp-pysec/wiki/Unrestricted-code-execution-using-pickle
(โ†’ This article should also mention that cPickle is also affected!)

As a workaround I implemented this solution:

fd = StringIO(data)
unpickler = cPickle.Unpickler(fd)
unpickler.find_global = None
return unpickler.load()

It could be suggested as an hotfix for currently vulnerable projects which need to support the current API's. This is probably not 100% save (I can't proove), but increases security a lot.

Remove unused modules in 'owasp-pysec/pysec/net/__init__.py'

Remove unused modules in 'owasp-pysec/pysec/net/init.py'

owasp-pysec/pysec/net/init.py:21: 'smtp' imported but unused
owasp-pysec/pysec/net/init.py:21: 'pop' imported but unused
owasp-pysec/pysec/net/init.py:21: 'error' imported but unused

Remove unused modules in 'owasp-pysec/pysec/core/__init__.py'

Remove unused modules in 'owasp-pysec/pysec/core/init.py'

owasp-pysec/pysec/core/init.py:20: 'monotonic' imported but unused
owasp-pysec/pysec/core/init.py:20: 'unistd' imported but unused
owasp-pysec/pysec/core/init.py:20: 'memory' imported but unused

Remove unused modules in 'owasp-pysec/pysec/io/__init__.py'

Remove unused modules in 'owasp-pysec/pysec/io/init.py'

owasp-pysec/pysec/io/init.py:20: 'fs' imported but unused
owasp-pysec/pysec/io/init.py:20: 'utils' imported but unused
owasp-pysec/pysec/io/init.py:20: 'fcheck' imported but unused
owasp-pysec/pysec/io/init.py:20: 'temp' imported but unused
owasp-pysec/pysec/io/init.py:20: 'fd' imported but unused

Content for "Secure Implementation": Incomplete?

Hi, so you've posted some material about Python security, and you have a nice review of various Python functions, but then all of the "Secure Implementation" sections say "Work in progress"; I don't really feel like you've answered what seems to be the main point of your posting, which is Python security, which I imagine is implementing Python securely. I liked your lists "Security IN Python" and "Security OF Python", but I don't seem to be able to find much about these topics and how to implement them. Are you planning to update this repository at some point? Or could you point us to some other resources if you're going to leave this topic incomplete? Thanks.

Build failed in mac os x

running install
running build
running build_py
running build_ext
building 'pysec.core.unistd' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pysec/core/unistd.c -o build/temp.macosx-10.11-intel-2.7/pysec/core/unistd.o
pysec/core/unistd.c:547:27: warning: implicit declaration of function
'fdatasync' is invalid in C99 [-Wimplicit-function-declaration]
return PyInt_FromLong(fdatasync(fildes) == 0 ? 0 : errno);
^
1 warning generated.
pysec/core/unistd.c:317:13: warning: implicit conversion loses integer
precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
if((end=strspn(salt, VALID_SALT_CHARS)) != strlen(salt))
~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pysec/core/unistd.c:436:21: warning: implicit conversion loses integer
precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
if((block_len = strlen(block)) != 64)
~ ^~~~~~~~~~~~~
pysec/core/unistd.c:439:13: warning: implicit conversion loses integer
precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
if((end=strspn(block, "01")) != strlen(block))
~^~~~~~~~~~~~~~~~~~~
pysec/core/unistd.c:547:27: warning: implicit declaration of function
'fdatasync' is invalid in C99 [-Wimplicit-function-declaration]
return PyInt_FromLong(fdatasync(fildes) == 0 ? 0 : errno);
^
pysec/core/unistd.c:1171:11: warning: implicit conversion loses integer
precision: 'long' to 'int' [-Wshorten-64-to-32]
res = sysconf(name);
~ ^~~~~~~~~~~~~
5 warnings generated.
cc -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -Wl,-F. build/temp.macosx-10.11-intel-2.7/pysec/core/unistd.o -lcrypt -o build/lib.macosx-10.11-intel-2.7/pysec/core/unistd.so
ld: library not found for -lcrypt
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'cc' failed with exit status 1

Option to Open and create if missing in "./pysec/io/fd.py"

Option to Open and create if missing in "./pysec/io/fd.py"

  • try to open a file as read-only
    -- if file is missing create the file
  • try to write a file as write-only
    -- if file is missing create the file
  • try to append to file as write-only
    -- if file is missing create the file

Fix probelms in 'memory.c' library

Fix following problems in memory.c library.
Line 69:
|---> Initial value of MemoryType_members[0].offset is type int, expects Py_ssize_t: ((int)&((MemoryObject *)0)->size
Line 70:
|---> 70|Initializer block for MemoryType_members[1] has 1 field, but PyMemberDef has 5 fields
Line 96:
|---> Initializer block for MemoryType_members[1] has 1 field, but PyMethodDef has 4 fields
Line 257:
|---> Assignment of ssize_t to size_t
Line 266:
|---> Parameter end not used

Core library tests

Define and build a set of tests to validate basic functionality of existing code.

Remove unused modules in 'owasp-pysec/pysec/__init__.py'

Remove unused modules in 'owasp-pysec/pysec/init.py'

owasp-pysec/pysec/init.py:21: 'alg' imported but unused
owasp-pysec/pysec/init.py:21: 'net' imported but unused
owasp-pysec/pysec/init.py:21: 'log' imported but unused
owasp-pysec/pysec/init.py:21: 'xsplit' imported but unused
owasp-pysec/pysec/init.py:21: 'load' imported but unused
owasp-pysec/pysec/init.py:21: 'kv' imported but unused
owasp-pysec/pysec/init.py:21: 'expr' imported but unused
owasp-pysec/pysec/init.py:21: 'stats' imported but unused
owasp-pysec/pysec/init.py:21: 'core' imported but unused
owasp-pysec/pysec/init.py:21: 'entropy' imported but unused

Option to Open and truncate in "./pysec/io/fd.py"

Option to Open and truncate in "./pysec/io/fd.py"

  • try to open a file as read-only
    -- if file exists close read only
    --- then open as write only
    ---- and if file exists truncate the file to size (x)
  • try to write to a file as write-only
    -- if file exists truncate the file to size (x)
  • try to append to file as write-only
    -- if file exists truncate the file to size (x)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.