{"id":19976784,"url":"https://github.com/tolik-punkoff/eval-security-bug-example","last_synced_at":"2026-06-09T03:02:51.246Z","repository":{"id":150006514,"uuid":"236085513","full_name":"tolik-punkoff/eval-security-bug-example","owner":"tolik-punkoff","description":"The example shows the danger of using the eval in bash. There is an example of dangerous and safe code.","archived":false,"fork":false,"pushed_at":"2020-02-07T22:28:48.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-12T10:07:51.069Z","etag":null,"topics":["bug","danger","demo","eval","security"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tolik-punkoff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2020-01-24T21:20:05.000Z","updated_at":"2020-02-07T22:28:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"328523fa-9f80-425a-8d82-7579ac07673f","html_url":"https://github.com/tolik-punkoff/eval-security-bug-example","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/tolik-punkoff%2Feval-security-bug-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tolik-punkoff%2Feval-security-bug-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tolik-punkoff%2Feval-security-bug-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tolik-punkoff%2Feval-security-bug-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tolik-punkoff","download_url":"https://codeload.github.com/tolik-punkoff/eval-security-bug-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241411543,"owners_count":19958753,"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":["bug","danger","demo","eval","security"],"created_at":"2024-11-13T03:25:33.462Z","updated_at":"2026-06-09T03:02:46.213Z","avatar_url":"https://github.com/tolik-punkoff.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eval-security-bug-example\nThe example shows the danger of using the eval in bash. There is an example of dangerous and safe code.\n\n## English\n\nFiles:\n\nmaketestdir - script for create test directories\n\ntestfile.txt - Test file. Danger fixed if you use single quotes in you code.\n\ntestfile2.txt - Test file. Danger fixed if you delete in code single quotes from input string and use single quotes in you code.\n\nwrongcode - Script with no fix (using double quotes in code)\n\nwrongcode - Script with first fix (using single quotes in code)\n\ngoodcode - Final fix. Code remove single quotes from input string and use single quotes in code\n\nUsing scripts:\n\nscript_name test_file\n\ne.q.\n\nwrongcode testfile2.txt\n\n\n\n## Русский язык\n\nПример показывает опасность использования eval в bash. Имеется пример опасного и безопасного кода.\n\nФайлы:\n\nmaketestdir - скрипт для создания тестовых каталогов.\n\ntestfile.txt - Тестовый файл. Ошибку безопасности можно обойти, заменив двойные кавычки одинарными в коде.\n\ntestfile2.txt - Замена двойных кавычек одинарными не поможет. Необходимо дополнительно удалять одинарные кавычки во входной строке.\n\nwrongcode - файл без исправлений кода (в коде используются двойные кавычки)\n\nwrongcode2 - только первое исправление (в коде используются одинарные кавычки)\n\ngoodcode - окончательно исправленный код (удаляются одинарные кавычки из входных строк).\n\nВызов скриптов: \u003cскрипт\u003e \u003cтестовый файл\u003e\n\nНапример:\n\nwrongcode testfile2.txt","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftolik-punkoff%2Feval-security-bug-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftolik-punkoff%2Feval-security-bug-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftolik-punkoff%2Feval-security-bug-example/lists"}