{"url":"https://api.github.com/repos/devwithkrishna/example-python-application/pulls/4","id":2455512883,"node_id":"PR_kwDOOXcz-c6SXCcz","html_url":"https://github.com/devwithkrishna/example-python-application/pull/4","diff_url":"https://github.com/devwithkrishna/example-python-application/pull/4.diff","patch_url":"https://github.com/devwithkrishna/example-python-application/pull/4.patch","issue_url":"https://api.github.com/repos/devwithkrishna/example-python-application/issues/4","number":4,"state":"closed","locked":false,"title":"If unsanitized user input is written to a log entry, a malicious user…","user":{"login":"githubofkrishnadhas","id":108367225,"node_id":"U_kgDOBnWNeQ","avatar_url":"https://avatars.githubusercontent.com/u/108367225?v=4","gravatar_id":"","url":"https://api.github.com/users/githubofkrishnadhas","html_url":"https://github.com/githubofkrishnadhas","followers_url":"https://api.github.com/users/githubofkrishnadhas/followers","following_url":"https://api.github.com/users/githubofkrishnadhas/following{/other_user}","gists_url":"https://api.github.com/users/githubofkrishnadhas/gists{/gist_id}","starred_url":"https://api.github.com/users/githubofkrishnadhas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/githubofkrishnadhas/subscriptions","organizations_url":"https://api.github.com/users/githubofkrishnadhas/orgs","repos_url":"https://api.github.com/users/githubofkrishnadhas/repos","events_url":"https://api.github.com/users/githubofkrishnadhas/events{/privacy}","received_events_url":"https://api.github.com/users/githubofkrishnadhas/received_events","type":"User","user_view_type":"public","site_admin":false},"body":"… may be able to forge new log entries.\r\n\r\n\r\nIssue #1 \r\n\r\nTo fix the log injection issue, we need to sanitize the user input before logging it. Specifically, we should remove any newline characters from the user input to prevent log forgery. This can be done by replacing \\r\\n and \\n with empty strings.\r\n\r\nWe will modify the code to sanitize the item before logging it. This involves converting the item to a string and then replacing any newline characters.\r\n","created_at":"2025-04-12T17:28:59Z","updated_at":"2025-04-12T17:30:51Z","closed_at":"2025-04-12T17:30:51Z","merged_at":"2025-04-12T17:30:51Z","merge_commit_sha":"2844f1ec2397b4f3f0ccf5830ec6a6e675062e02","assignees":[{"login":"githubofkrishnadhas","id":108367225,"node_id":"U_kgDOBnWNeQ","avatar_url":"https://avatars.githubusercontent.com/u/108367225?v=4","gravatar_id":"","url":"https://api.github.com/users/githubofkrishnadhas","html_url":"https://github.com/githubofkrishnadhas","followers_url":"https://api.github.com/users/githubofkrishnadhas/followers","following_url":"https://api.github.com/users/githubofkrishnadhas/following{/other_user}","gists_url":"https://api.github.com/users/githubofkrishnadhas/gists{/gist_id}","starred_url":"https://api.github.com/users/githubofkrishnadhas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/githubofkrishnadhas/subscriptions","organizations_url":"https://api.github.com/users/githubofkrishnadhas/orgs","repos_url":"https://api.github.com/users/githubofkrishnadhas/repos","events_url":"https://api.github.com/users/githubofkrishnadhas/events{/privacy}","received_events_url":"https://api.github.com/users/githubofkrishnadhas/received_events","type":"User","user_view_type":"public","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":8445793274,"node_id":"LA_kwDOOXcz-c8AAAAB92iT-g","url":"https://api.github.com/repos/devwithkrishna/example-python-application/labels/patch","name":"patch","color":"81227A","default":false,"description":""}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/devwithkrishna/example-python-application/pulls/4/commits","review_comments_url":"https://api.github.com/repos/devwithkrishna/example-python-application/pulls/4/comments","review_comment_url":"https://api.github.com/repos/devwithkrishna/example-python-application/pulls/comments{/number}","comments_url":"https://api.github.com/repos/devwithkrishna/example-python-application/issues/4/comments","statuses_url":"https://api.github.com/repos/devwithkrishna/example-python-application/statuses/f09d61fe93c55b81cc2999d5771c09e2b996c495","head":{"label":"devwithkrishna:hotfix/loginjection-issue","ref":"hotfix/loginjection-issue","sha":"f09d61fe93c55b81cc2999d5771c09e2b996c495","user":{"login":"devwithkrishna","id":136187625,"node_id":"O_kgDOCB4O6Q","avatar_url":"https://avatars.githubusercontent.com/u/136187625?v=4","gravatar_id":"","url":"https://api.github.com/users/devwithkrishna","html_url":"https://github.com/devwithkrishna","followers_url":"https://api.github.com/users/devwithkrishna/followers","following_url":"https://api.github.com/users/devwithkrishna/following{/other_user}","gists_url":"https://api.github.com/users/devwithkrishna/gists{/gist_id}","starred_url":"https://api.github.com/users/devwithkrishna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devwithkrishna/subscriptions","organizations_url":"https://api.github.com/users/devwithkrishna/orgs","repos_url":"https://api.github.com/users/devwithkrishna/repos","events_url":"https://api.github.com/users/devwithkrishna/events{/privacy}","received_events_url":"https://api.github.com/users/devwithkrishna/received_events","type":"Organization","user_view_type":"public","site_admin":false},"repo":{"id":964113401,"node_id":"R_kgDOOXcz-Q","name":"example-python-application","full_name":"devwithkrishna/example-python-application","private":false,"owner":{"login":"devwithkrishna","id":136187625,"node_id":"O_kgDOCB4O6Q","avatar_url":"https://avatars.githubusercontent.com/u/136187625?v=4","gravatar_id":"","url":"https://api.github.com/users/devwithkrishna","html_url":"https://github.com/devwithkrishna","followers_url":"https://api.github.com/users/devwithkrishna/followers","following_url":"https://api.github.com/users/devwithkrishna/following{/other_user}","gists_url":"https://api.github.com/users/devwithkrishna/gists{/gist_id}","starred_url":"https://api.github.com/users/devwithkrishna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devwithkrishna/subscriptions","organizations_url":"https://api.github.com/users/devwithkrishna/orgs","repos_url":"https://api.github.com/users/devwithkrishna/repos","events_url":"https://api.github.com/users/devwithkrishna/events{/privacy}","received_events_url":"https://api.github.com/users/devwithkrishna/received_events","type":"Organization","user_view_type":"public","site_admin":false},"html_url":"https://github.com/devwithkrishna/example-python-application","description":"Sample python application ","fork":false,"url":"https://api.github.com/repos/devwithkrishna/example-python-application","forks_url":"https://api.github.com/repos/devwithkrishna/example-python-application/forks","keys_url":"https://api.github.com/repos/devwithkrishna/example-python-application/keys{/key_id}","collaborators_url":"https://api.github.com/repos/devwithkrishna/example-python-application/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/devwithkrishna/example-python-application/teams","hooks_url":"https://api.github.com/repos/devwithkrishna/example-python-application/hooks","issue_events_url":"https://api.github.com/repos/devwithkrishna/example-python-application/issues/events{/number}","events_url":"https://api.github.com/repos/devwithkrishna/example-python-application/events","assignees_url":"https://api.github.com/repos/devwithkrishna/example-python-application/assignees{/user}","branches_url":"https://api.github.com/repos/devwithkrishna/example-python-application/branches{/branch}","tags_url":"https://api.github.com/repos/devwithkrishna/example-python-application/tags","blobs_url":"https://api.github.com/repos/devwithkrishna/example-python-application/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/devwithkrishna/example-python-application/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/devwithkrishna/example-python-application/git/refs{/sha}","trees_url":"https://api.github.com/repos/devwithkrishna/example-python-application/git/trees{/sha}","statuses_url":"https://api.github.com/repos/devwithkrishna/example-python-application/statuses/{sha}","languages_url":"https://api.github.com/repos/devwithkrishna/example-python-application/languages","stargazers_url":"https://api.github.com/repos/devwithkrishna/example-python-application/stargazers","contributors_url":"https://api.github.com/repos/devwithkrishna/example-python-application/contributors","subscribers_url":"https://api.github.com/repos/devwithkrishna/example-python-application/subscribers","subscription_url":"https://api.github.com/repos/devwithkrishna/example-python-application/subscription","commits_url":"https://api.github.com/repos/devwithkrishna/example-python-application/commits{/sha}","git_commits_url":"https://api.github.com/repos/devwithkrishna/example-python-application/git/commits{/sha}","comments_url":"https://api.github.com/repos/devwithkrishna/example-python-application/comments{/number}","issue_comment_url":"https://api.github.com/repos/devwithkrishna/example-python-application/issues/comments{/number}","contents_url":"https://api.github.com/repos/devwithkrishna/example-python-application/contents/{+path}","compare_url":"https://api.github.com/repos/devwithkrishna/example-python-application/compare/{base}...{head}","merges_url":"https://api.github.com/repos/devwithkrishna/example-python-application/merges","archive_url":"https://api.github.com/repos/devwithkrishna/example-python-application/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/devwithkrishna/example-python-application/downloads","issues_url":"https://api.github.com/repos/devwithkrishna/example-python-application/issues{/number}","pulls_url":"https://api.github.com/repos/devwithkrishna/example-python-application/pulls{/number}","milestones_url":"https://api.github.com/repos/devwithkrishna/example-python-application/milestones{/number}","notifications_url":"https://api.github.com/repos/devwithkrishna/example-python-application/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/devwithkrishna/example-python-application/labels{/name}","releases_url":"https://api.github.com/repos/devwithkrishna/example-python-application/releases{/id}","deployments_url":"https://api.github.com/repos/devwithkrishna/example-python-application/deployments","created_at":"2025-04-10T17:55:06Z","updated_at":"2025-04-17T17:00:56Z","pushed_at":"2025-04-17T17:01:34Z","git_url":"git://github.com/devwithkrishna/example-python-application.git","ssh_url":"git@github.com:devwithkrishna/example-python-application.git","clone_url":"https://github.com/devwithkrishna/example-python-application.git","svn_url":"https://github.com/devwithkrishna/example-python-application","homepage":"","size":17,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"has_pull_requests":true,"pull_request_creation_policy":"all","topics":["docker","dockerized","fastapi","poetry","python","swagger"],"visibility":"public","forks":0,"open_issues":1,"watchers":0,"default_branch":"main"}},"base":{"label":"devwithkrishna:main","ref":"main","sha":"6ee1fd2fa42eec0a523d91a42387833a3e9b76a8","user":{"login":"devwithkrishna","id":136187625,"node_id":"O_kgDOCB4O6Q","avatar_url":"https://avatars.githubusercontent.com/u/136187625?v=4","gravatar_id":"","url":"https://api.github.com/users/devwithkrishna","html_url":"https://github.com/devwithkrishna","followers_url":"https://api.github.com/users/devwithkrishna/followers","following_url":"https://api.github.com/users/devwithkrishna/following{/other_user}","gists_url":"https://api.github.com/users/devwithkrishna/gists{/gist_id}","starred_url":"https://api.github.com/users/devwithkrishna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devwithkrishna/subscriptions","organizations_url":"https://api.github.com/users/devwithkrishna/orgs","repos_url":"https://api.github.com/users/devwithkrishna/repos","events_url":"https://api.github.com/users/devwithkrishna/events{/privacy}","received_events_url":"https://api.github.com/users/devwithkrishna/received_events","type":"Organization","user_view_type":"public","site_admin":false},"repo":{"id":964113401,"node_id":"R_kgDOOXcz-Q","name":"example-python-application","full_name":"devwithkrishna/example-python-application","private":false,"owner":{"login":"devwithkrishna","id":136187625,"node_id":"O_kgDOCB4O6Q","avatar_url":"https://avatars.githubusercontent.com/u/136187625?v=4","gravatar_id":"","url":"https://api.github.com/users/devwithkrishna","html_url":"https://github.com/devwithkrishna","followers_url":"https://api.github.com/users/devwithkrishna/followers","following_url":"https://api.github.com/users/devwithkrishna/following{/other_user}","gists_url":"https://api.github.com/users/devwithkrishna/gists{/gist_id}","starred_url":"https://api.github.com/users/devwithkrishna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devwithkrishna/subscriptions","organizations_url":"https://api.github.com/users/devwithkrishna/orgs","repos_url":"https://api.github.com/users/devwithkrishna/repos","events_url":"https://api.github.com/users/devwithkrishna/events{/privacy}","received_events_url":"https://api.github.com/users/devwithkrishna/received_events","type":"Organization","user_view_type":"public","site_admin":false},"html_url":"https://github.com/devwithkrishna/example-python-application","description":"Sample python application ","fork":false,"url":"https://api.github.com/repos/devwithkrishna/example-python-application","forks_url":"https://api.github.com/repos/devwithkrishna/example-python-application/forks","keys_url":"https://api.github.com/repos/devwithkrishna/example-python-application/keys{/key_id}","collaborators_url":"https://api.github.com/repos/devwithkrishna/example-python-application/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/devwithkrishna/example-python-application/teams","hooks_url":"https://api.github.com/repos/devwithkrishna/example-python-application/hooks","issue_events_url":"https://api.github.com/repos/devwithkrishna/example-python-application/issues/events{/number}","events_url":"https://api.github.com/repos/devwithkrishna/example-python-application/events","assignees_url":"https://api.github.com/repos/devwithkrishna/example-python-application/assignees{/user}","branches_url":"https://api.github.com/repos/devwithkrishna/example-python-application/branches{/branch}","tags_url":"https://api.github.com/repos/devwithkrishna/example-python-application/tags","blobs_url":"https://api.github.com/repos/devwithkrishna/example-python-application/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/devwithkrishna/example-python-application/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/devwithkrishna/example-python-application/git/refs{/sha}","trees_url":"https://api.github.com/repos/devwithkrishna/example-python-application/git/trees{/sha}","statuses_url":"https://api.github.com/repos/devwithkrishna/example-python-application/statuses/{sha}","languages_url":"https://api.github.com/repos/devwithkrishna/example-python-application/languages","stargazers_url":"https://api.github.com/repos/devwithkrishna/example-python-application/stargazers","contributors_url":"https://api.github.com/repos/devwithkrishna/example-python-application/contributors","subscribers_url":"https://api.github.com/repos/devwithkrishna/example-python-application/subscribers","subscription_url":"https://api.github.com/repos/devwithkrishna/example-python-application/subscription","commits_url":"https://api.github.com/repos/devwithkrishna/example-python-application/commits{/sha}","git_commits_url":"https://api.github.com/repos/devwithkrishna/example-python-application/git/commits{/sha}","comments_url":"https://api.github.com/repos/devwithkrishna/example-python-application/comments{/number}","issue_comment_url":"https://api.github.com/repos/devwithkrishna/example-python-application/issues/comments{/number}","contents_url":"https://api.github.com/repos/devwithkrishna/example-python-application/contents/{+path}","compare_url":"https://api.github.com/repos/devwithkrishna/example-python-application/compare/{base}...{head}","merges_url":"https://api.github.com/repos/devwithkrishna/example-python-application/merges","archive_url":"https://api.github.com/repos/devwithkrishna/example-python-application/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/devwithkrishna/example-python-application/downloads","issues_url":"https://api.github.com/repos/devwithkrishna/example-python-application/issues{/number}","pulls_url":"https://api.github.com/repos/devwithkrishna/example-python-application/pulls{/number}","milestones_url":"https://api.github.com/repos/devwithkrishna/example-python-application/milestones{/number}","notifications_url":"https://api.github.com/repos/devwithkrishna/example-python-application/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/devwithkrishna/example-python-application/labels{/name}","releases_url":"https://api.github.com/repos/devwithkrishna/example-python-application/releases{/id}","deployments_url":"https://api.github.com/repos/devwithkrishna/example-python-application/deployments","created_at":"2025-04-10T17:55:06Z","updated_at":"2025-04-17T17:00:56Z","pushed_at":"2025-04-17T17:01:34Z","git_url":"git://github.com/devwithkrishna/example-python-application.git","ssh_url":"git@github.com:devwithkrishna/example-python-application.git","clone_url":"https://github.com/devwithkrishna/example-python-application.git","svn_url":"https://github.com/devwithkrishna/example-python-application","homepage":"","size":17,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"has_pull_requests":true,"pull_request_creation_policy":"all","topics":["docker","dockerized","fastapi","poetry","python","swagger"],"visibility":"public","forks":0,"open_issues":1,"watchers":0,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/devwithkrishna/example-python-application/pulls/4"},"html":{"href":"https://github.com/devwithkrishna/example-python-application/pull/4"},"issue":{"href":"https://api.github.com/repos/devwithkrishna/example-python-application/issues/4"},"comments":{"href":"https://api.github.com/repos/devwithkrishna/example-python-application/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/devwithkrishna/example-python-application/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/devwithkrishna/example-python-application/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/devwithkrishna/example-python-application/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/devwithkrishna/example-python-application/statuses/f09d61fe93c55b81cc2999d5771c09e2b996c495"}},"author_association":"CONTRIBUTOR","auto_merge":null,"assignee":{"login":"githubofkrishnadhas","id":108367225,"node_id":"U_kgDOBnWNeQ","avatar_url":"https://avatars.githubusercontent.com/u/108367225?v=4","gravatar_id":"","url":"https://api.github.com/users/githubofkrishnadhas","html_url":"https://github.com/githubofkrishnadhas","followers_url":"https://api.github.com/users/githubofkrishnadhas/followers","following_url":"https://api.github.com/users/githubofkrishnadhas/following{/other_user}","gists_url":"https://api.github.com/users/githubofkrishnadhas/gists{/gist_id}","starred_url":"https://api.github.com/users/githubofkrishnadhas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/githubofkrishnadhas/subscriptions","organizations_url":"https://api.github.com/users/githubofkrishnadhas/orgs","repos_url":"https://api.github.com/users/githubofkrishnadhas/repos","events_url":"https://api.github.com/users/githubofkrishnadhas/events{/privacy}","received_events_url":"https://api.github.com/users/githubofkrishnadhas/received_events","type":"User","user_view_type":"public","site_admin":false},"active_lock_reason":null,"merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"githubofkrishnadhas","id":108367225,"node_id":"U_kgDOBnWNeQ","avatar_url":"https://avatars.githubusercontent.com/u/108367225?v=4","gravatar_id":"","url":"https://api.github.com/users/githubofkrishnadhas","html_url":"https://github.com/githubofkrishnadhas","followers_url":"https://api.github.com/users/githubofkrishnadhas/followers","following_url":"https://api.github.com/users/githubofkrishnadhas/following{/other_user}","gists_url":"https://api.github.com/users/githubofkrishnadhas/gists{/gist_id}","starred_url":"https://api.github.com/users/githubofkrishnadhas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/githubofkrishnadhas/subscriptions","organizations_url":"https://api.github.com/users/githubofkrishnadhas/orgs","repos_url":"https://api.github.com/users/githubofkrishnadhas/repos","events_url":"https://api.github.com/users/githubofkrishnadhas/events{/privacy}","received_events_url":"https://api.github.com/users/githubofkrishnadhas/received_events","type":"User","user_view_type":"public","site_admin":false},"comments":0,"review_comments":2,"maintainer_can_modify":false,"commits":1,"additions":2,"deletions":1,"changed_files":1}