Title: Error when calling createComment with markdown in body · Issue #723 · actions/github-script · GitHub
Open Graph Title: Error when calling createComment with markdown in body · Issue #723 · actions/github-script
X Title: Error when calling createComment with markdown in body · Issue #723 · actions/github-script
Description: Describe the bug The following error is thrown: Error: Unhandled error: SyntaxError: Unexpected identifier 'pickle' To Reproduce Steps to reproduce the behavior: run the following action step: - name: Create comment uses: actions/github-...
Open Graph Description: Describe the bug The following error is thrown: Error: Unhandled error: SyntaxError: Unexpected identifier 'pickle' To Reproduce Steps to reproduce the behavior: run the following action step: - na...
X Description: Describe the bug The following error is thrown: Error: Unhandled error: SyntaxError: Unexpected identifier 'pickle' To Reproduce Steps to reproduce the behavior: run the following action st...
Opengraph URL: https://github.com/actions/github-script/issues/723
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Error when calling createComment with markdown in body","articleBody":"**Describe the bug**\nThe following error is thrown:\nError: Unhandled error: SyntaxError: Unexpected identifier 'pickle'\n\n**To Reproduce**\nSteps to reproduce the behavior:\nrun the following action step:\n\n```yaml\n - name: Create comment\n uses: actions/github-script@v9.0.0\n with:\n github-token: ${{ inputs.github-token }}\n script: |\n github.rest.issues.createComment({\n issue_number: context.issue.number,\n owner: context.repo.owner,\n repo: context.repo.repo,\n body: `### 1. **Arbitrary Code Execution via `pickle.loads()` on Untrusted Input** (`test01.py`)\n \n **Severity: CRITICAL**\n \n The file `test01.py` takes user input directly and passes it to `pickle.loads()`. This is a well-known **Remote Code Execution (RCE)** vulnerability. An attacker can craft a malicious pickle payload that executes arbitrary system commands upon deserialization.\n \n Additionally, `pickle.loads()` expects `bytes`, but `input()` returns a `str` in Python 3, so this code will also raise a **`TypeError`** at runtime.\n \n **File: `test01.py`**\n \n ```python\n # Current (vulnerable and broken):\n import pickle\n \n data = input(\"Enter serialized data: \")\n obj = pickle.loads(data)\n ```\n \n **Suggested fix:**\n \n ```python\n import json\n \n data = input(\"Enter serialized data: \")\n obj = json.loads(data)\n ```\n \n If `pickle` is absolutely required (not recommended with untrusted input), at minimum fix the type error and restrict allowed classes:\n \n ```python\n import pickle\n import io\n \n ALLOWED_CLASSES = {\n # explicitly list allowed classes here\n }\n \n class RestrictedUnpickler(pickle.Unpickler):\n def find_class(self, module, name):\n if (module, name) in ALLOWED_CLASSES:\n return ALLOWED_CLASSES[(module, name)]\n raise pickle.UnpicklingError(f\"Forbidden class: {module}.{name}\")\n \n data = input(\"Enter serialized data: \")\n obj = RestrictedUnpickler(io.BytesIO(data.encode('latin-1'))).load()\n ```\n `\n })\n```\n\n**Expected behavior**\nNo error and comment is created.\n\n**Desktop (please complete the following information):**\n - OS: Ubuntu 22.04\n - Runner 2.331.0\n\n\n**Additional context**\nThe markdown text is actually a dynamic response generated by a LLM, hence no way to modify the markdown contents.","author":{"url":"https://github.com/wkwi2r","@type":"Person","name":"wkwi2r"},"datePublished":"2026-07-16T03:21:01Z","url":"https://github.com/actions/github-script/issues/723"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d8bcb2eb-a74b-6eb9-9072-ec4fc40bcbbe |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AACA:26ECEB:3315777:40F592D:6B01C3A9 |
| html-safe-nonce | 19364e2276c86d35cfb911d24612928528074d53de3e5bb4f41c7088de5911a6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQUNBOjI2RUNFQjozMzE1Nzc3OjQwRjU5MkQ6NkIwMUMzQTkiLCJ2aXNpdG9yX2lkIjoiMzk1NzE1NjA5NDA1NjQ0ODkzNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ecae8e342f6b3ccf1f4939738720875e790249afe401d52f417e3e92e7c721c7 |
| hovercard-subject-tag | issue:4898364677 |
| github-keyboard-shortcuts | repository,issues,actions,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/actions/github-script/723/issue_layout |
| twitter:image | https://opengraph.githubassets.com/664554d8b3e0efb5b62ab22463fb5587d7a0d0aac8d461db47dd23a26f77fb34/actions/github-script/issues/723 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/664554d8b3e0efb5b62ab22463fb5587d7a0d0aac8d461db47dd23a26f77fb34/actions/github-script/issues/723 |
| og:image:alt | Describe the bug The following error is thrown: Error: Unhandled error: SyntaxError: Unexpected identifier 'pickle' To Reproduce Steps to reproduce the behavior: run the following action step: - na... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | wkwi2r |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/actions/github-script git https://github.com/actions/github-script.git |
| octolytics-dimension-user_id | 44036562 |
| octolytics-dimension-user_login | actions |
| octolytics-dimension-repository_id | 205262760 |
| octolytics-dimension-repository_nwo | actions/github-script |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 205262760 |
| octolytics-dimension-repository_network_root_nwo | actions/github-script |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width