{"id":16617540,"url":"https://github.com/ddworken/taint","last_synced_at":"2025-03-11T04:22:52.425Z","repository":{"id":80931864,"uuid":"92692990","full_name":"ddworken/taint","owner":"ddworken","description":"taint: Compile time taint analysis for python","archived":false,"fork":false,"pushed_at":"2017-06-04T18:56:16.000Z","size":23,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-17T19:51:26.441Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ddworken.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-28T23:25:57.000Z","updated_at":"2021-08-05T09:17:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"4b0ee450-5974-477b-b4ed-c47ecf44da20","html_url":"https://github.com/ddworken/taint","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddworken%2Ftaint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddworken%2Ftaint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddworken%2Ftaint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddworken%2Ftaint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ddworken","download_url":"https://codeload.github.com/ddworken/taint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242968494,"owners_count":20214471,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T02:17:03.645Z","updated_at":"2025-03-11T04:22:52.415Z","avatar_url":"https://github.com/ddworken.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# taint: Compile time taint analysis for python using mypy\n\n### Status: WIP\n\n## Intro\n\ntaint is an experiment in implementing compile time taint analysis based off of type annotations and mypy. There are three key decorators built in to taint: ```@taint```, ```@sanitize```, and ```@sink```. The ```@taint``` decorator should be used to decorate functions that return tainted data. The ```@sanitize``` decorator should be used to decorate functions that given tainted data return untainted data. The ```@sink``` decorator should be used to decorate functions that should never be fed tainted data. \n\nWhen mypy is run against this code: \n\n``` python\nfrom taint import taint, sanitize, sink\nfrom flask import Flask, request\napp = Flask(__name__)\n\n@app.route('/')\ndef main() -\u003e str:\n    return greetingStr(getName(request))\n\n@taint\ndef getName(request):\n    return request.args.get('user')\n\n@sink\ndef greetingStr(username):\n    return 'Hello %s!' % username \n```\n\nit throws an error: \n\n```\nexamples/taint_simpleFlaskWebsite.py:7: error: Argument 1 to \"greetingStr\" has incompatible type Tainted[Any]; expected Untainted[Any]\n```\n\n## Limitations\n\nThere are currently a number of ways of bypassing taint's tracking listed below from most to least likely to accidentally happen:\n\nIn python, ```str.join(data)``` requires that data be a list of strings (it does not call ```__str__``` on each object). This means that ''.join(Tainted(data)) returns untainted data.\n\nImplicit flows aka:\n\n```\nvar = Tainted(\"str\")\nif var == \"str\":\n   var = \"str\"\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddworken%2Ftaint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fddworken%2Ftaint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddworken%2Ftaint/lists"}