{"action":"created","issue":{"url":"https://api.github.com/repos/opencart/opencart/issues/6603","repository_url":"https://api.github.com/repos/opencart/opencart","labels_url":"https://api.github.com/repos/opencart/opencart/issues/6603/labels{/name}","comments_url":"https://api.github.com/repos/opencart/opencart/issues/6603/comments","events_url":"https://api.github.com/repos/opencart/opencart/issues/6603/events","html_url":"https://github.com/opencart/opencart/issues/6603","id":316182550,"number":6603,"title":"Postcode not properly escaped in Square Up payment module","user":{"login":"miklcct","id":2827264,"avatar_url":"https://avatars1.githubusercontent.com/u/2827264?v=4","gravatar_id":"","url":"https://api.github.com/users/miklcct","html_url":"https://github.com/miklcct","followers_url":"https://api.github.com/users/miklcct/followers","following_url":"https://api.github.com/users/miklcct/following{/other_user}","gists_url":"https://api.github.com/users/miklcct/gists{/gist_id}","starred_url":"https://api.github.com/users/miklcct/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miklcct/subscriptions","organizations_url":"https://api.github.com/users/miklcct/orgs","repos_url":"https://api.github.com/users/miklcct/repos","events_url":"https://api.github.com/users/miklcct/events{/privacy}","received_events_url":"https://api.github.com/users/miklcct/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-04-20T08:52:09Z","updated_at":"2018-04-20T12:48:41Z","closed_at":null,"author_association":"NONE","body":"The post code field is not properly escaped in the Square Up module, making script injection a possibility.\r\n\r\nSteps to reproduce:\r\n1. Configure and enable the square payment module\r\n2. Add something to shopping cart and make a guest order\r\n3. Enter `');alert('test');('` into the post code field when entering the shipping address\r\n4. Choose Credit / Debit card (square) as the payment method.\r\n\r\nThe result is an alert box saying 'test' has pop up.\r\n"},"comment":{"url":"https://api.github.com/repos/opencart/opencart/issues/comments/383085159","html_url":"https://github.com/opencart/opencart/issues/6603#issuecomment-383085159","issue_url":"https://api.github.com/repos/opencart/opencart/issues/6603","id":383085159,"user":{"login":"ADDCreative","id":2039130,"avatar_url":"https://avatars2.githubusercontent.com/u/2039130?v=4","gravatar_id":"","url":"https://api.github.com/users/ADDCreative","html_url":"https://github.com/ADDCreative","followers_url":"https://api.github.com/users/ADDCreative/followers","following_url":"https://api.github.com/users/ADDCreative/following{/other_user}","gists_url":"https://api.github.com/users/ADDCreative/gists{/gist_id}","starred_url":"https://api.github.com/users/ADDCreative/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ADDCreative/subscriptions","organizations_url":"https://api.github.com/users/ADDCreative/orgs","repos_url":"https://api.github.com/users/ADDCreative/repos","events_url":"https://api.github.com/users/ADDCreative/events{/privacy}","received_events_url":"https://api.github.com/users/ADDCreative/received_events","type":"User","site_admin":false},"created_at":"2018-04-20T12:48:41Z","updated_at":"2018-04-20T12:48:41Z","author_association":"CONTRIBUTOR","body":"The issue is this line. https://github.com/opencart/opencart/blob/3.0.2.0/upload/catalog/view/theme/default/template/extension/payment/squareup.twig#L130\r\nWhich should probably be something like.\r\n```php\r\npaymentForm.setPostalCode('{{ payment_zip|escape('js') }}');\r\n```"}}
{"actor":{"display_login":"ADDCreative"}}