Repository navigation
Conversation
Failure-Class: none
There was a problem hiding this comment.
4 issues found across 3 files
Confidence score: 2/5
plugins/omi-clickup-app/clickup_client.pycan turn HTML in a ClickUp folder name into stored XSS when the settings template renderslst['name']unescaped, creating a direct security risk — escape folder/list names at the HTML rendering boundary before merging.plugins/omi-clickup-app/clickup_client.pytreats folder-fetch failures as an empty collection, so/refresh-listscan report success while silently dropping existing lists; propagate the failure or preserve the existing list set.plugins/omi-clickup-app/test_clickup_client.pydoes not cover the fallback path that callsget_folder_listswhen a folder response lackslists, leaving the new behavior insufficiently verified — add a focused test for that branch.plugins/omi-clickup-app/test_clickup_client.pyleaves globalrequestsanddotenvstubs installed, which can contaminate other tests in the same process; scope or clean up the module stubs.
You’re at about 90% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact [email protected].
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="plugins/omi-clickup-app/clickup_client.py">
<violation number="1" location="plugins/omi-clickup-app/clickup_client.py:242">
P2: When the folder request fails, this call treats the failure as an empty folder collection and returns a successful folderless subset. Propagate folder-fetch failure or preserve the existing list set so `/refresh-lists` does not hide all folder lists after a transient ClickUp error.</violation>
<violation number="2" location="plugins/omi-clickup-app/clickup_client.py:254">
P1: When a ClickUp folder name contains HTML, this new display name enables stored XSS in the settings page because the template renders `lst['name']` unescaped. Escape folder/list names at the HTML rendering boundary before inserting them into the option element.</violation>
</file>
<file name="plugins/omi-clickup-app/test_clickup_client.py">
<violation number="1" location="plugins/omi-clickup-app/test_clickup_client.py:16">
P3: The top-of-file stubbing replaces the global `requests` and `dotenv` modules in `sys.modules` for the whole process and never removes them. That is fine for this standalone `python3 ... test_clickup_client.py` run, but if the file is ever collected with other tests in the same pytest session, every subsequent `import requests` / `import dotenv` in that process gets the stub. Restore both module entries after importing `clickup_client`, or make the stubs conditional on the actual import failing, so the shadowing cannot leak beyond this module.</violation>
<violation number="2" location="plugins/omi-clickup-app/test_clickup_client.py:115">
P2: The integration test only exercises the branch where ClickUp embeds `lists` inside the folder response; the other new code path (folder dict has no `lists` key → `get_folder_lists` called, result reformatted with `folder_name / list_name`) is never exercised from `get_all_lists`. Also, the fail-closed test asserts individual methods return [] on 500 but never asserts `get_all_lists` itself fails closed (e.g., when `get_folders` errors). Add a case where the folder response omits `lists` and mock `get_folder_lists`, asserting its list appears with the combined display name, plus a 500-path assertion on `get_all_lists`.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
|
||
| for lst in folder_lists: | ||
| list_name = lst.get("name", "") | ||
| display_name = f"{folder_name} / {list_name}" if folder_name else list_name |
There was a problem hiding this comment.
P1: When a ClickUp folder name contains HTML, this new display name enables stored XSS in the settings page because the template renders lst['name'] unescaped. Escape folder/list names at the HTML rendering boundary before inserting them into the option element.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At plugins/omi-clickup-app/clickup_client.py, line 254:
<comment>When a ClickUp folder name contains HTML, this new display name enables stored XSS in the settings page because the template renders `lst['name']` unescaped. Escape folder/list names at the HTML rendering boundary before inserting them into the option element.</comment>
<file context>
@@ -161,32 +161,108 @@ def get_lists(self, access_token: str, space_id: str) -> List[Dict]:
+
+ for lst in folder_lists:
+ list_name = lst.get("name", "")
+ display_name = f"{folder_name} / {list_name}" if folder_name else list_name
+ all_lists.append({
+ "id": lst.get("id"),
</file context>
|
|
||
|
|
||
| # 2. Get lists organized within folders in the space | ||
| folders = self.get_folders(access_token, space_id) |
There was a problem hiding this comment.
P2: When the folder request fails, this call treats the failure as an empty folder collection and returns a successful folderless subset. Propagate folder-fetch failure or preserve the existing list set so /refresh-lists does not hide all folder lists after a transient ClickUp error.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At plugins/omi-clickup-app/clickup_client.py, line 242:
<comment>When the folder request fails, this call treats the failure as an empty folder collection and returns a successful folderless subset. Propagate folder-fetch failure or preserve the existing list set so `/refresh-lists` does not hide all folder lists after a transient ClickUp error.</comment>
<file context>
@@ -161,32 +161,108 @@ def get_lists(self, access_token: str, space_id: str) -> List[Dict]:
-
+
+ # 2. Get lists organized within folders in the space
+ folders = self.get_folders(access_token, space_id)
+ for folder in folders:
+ folder_id = folder.get("id")
</file context>
| { | ||
| "id": "folder-1", | ||
| "name": "Current Sprint", | ||
| "lists": [{"id": "list-2", "name": "Active Tasks"}] |
There was a problem hiding this comment.
P2: The integration test only exercises the branch where ClickUp embeds lists inside the folder response; the other new code path (folder dict has no lists key → get_folder_lists called, result reformatted with folder_name / list_name) is never exercised from get_all_lists. Also, the fail-closed test asserts individual methods return [] on 500 but never asserts get_all_lists itself fails closed (e.g., when get_folders errors). Add a case where the folder response omits lists and mock get_folder_lists, asserting its list appears with the combined display name, plus a 500-path assertion on get_all_lists.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At plugins/omi-clickup-app/test_clickup_client.py, line 115:
<comment>The integration test only exercises the branch where ClickUp embeds `lists` inside the folder response; the other new code path (folder dict has no `lists` key → `get_folder_lists` called, result reformatted with `folder_name / list_name`) is never exercised from `get_all_lists`. Also, the fail-closed test asserts individual methods return [] on 500 but never asserts `get_all_lists` itself fails closed (e.g., when `get_folders` errors). Add a case where the folder response omits `lists` and mock `get_folder_lists`, asserting its list appears with the combined display name, plus a 500-path assertion on `get_all_lists`.</comment>
<file context>
@@ -0,0 +1,148 @@
+ {
+ "id": "folder-1",
+ "name": "Current Sprint",
+ "lists": [{"id": "list-2", "name": "Active Tasks"}]
+ }
+ ]
</file context>
| requests_stub = types.ModuleType("requests") | ||
| requests_stub.get = lambda *args, **kwargs: None | ||
| requests_stub.post = lambda *args, **kwargs: None | ||
| sys.modules["requests"] = requests_stub |
There was a problem hiding this comment.
P3: The top-of-file stubbing replaces the global requests and dotenv modules in sys.modules for the whole process and never removes them. That is fine for this standalone python3 ... test_clickup_client.py run, but if the file is ever collected with other tests in the same pytest session, every subsequent import requests / import dotenv in that process gets the stub. Restore both module entries after importing clickup_client, or make the stubs conditional on the actual import failing, so the shadowing cannot leak beyond this module.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At plugins/omi-clickup-app/test_clickup_client.py, line 16:
<comment>The top-of-file stubbing replaces the global `requests` and `dotenv` modules in `sys.modules` for the whole process and never removes them. That is fine for this standalone `python3 ... test_clickup_client.py` run, but if the file is ever collected with other tests in the same pytest session, every subsequent `import requests` / `import dotenv` in that process gets the stub. Restore both module entries after importing `clickup_client`, or make the stubs conditional on the actual import failing, so the shadowing cannot leak beyond this module.</comment>
<file context>
@@ -0,0 +1,148 @@
+ requests_stub = types.ModuleType("requests")
+ requests_stub.get = lambda *args, **kwargs: None
+ requests_stub.post = lambda *args, **kwargs: None
+ sys.modules["requests"] = requests_stub
+
+import os
</file context>
|
Verified end to end against the ClickUp API v2 docs and by running the new suite locally (6/6 pass, fully hermetic -- all HTTP mocked, no network). The core diagnosis behind #13808 is correct: Per file:
On the injection point raised earlier in this thread: confirmed the sink. The settings page ( The folder-fetch failure mode (empty folder set, keep folderless lists) matches how Test-plan nit: the checklist says "6 passed in 0.001s"; locally it is 6 tests in ~0.002s -- just keep that line updated on re-runs. Overall this is a correct, focused fix with the right tests registered in the manifest. Leaving the HTML-escaping boundary decision for maintainer sign-off since it is a security-flagged path; the rest looks in good shape. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
…adation tests - HTML-escape list id, display_name, and workspace name in settings page - Add test asserting folder list fallback fetching when lists are not embedded - Add test asserting graceful degradation to folderless lists on folder fetch error Failure-Class: none
|
Thanks for the thorough review and feedback @Git-on-my-level!
|
|
Follow-up review on 5bd1d0d — verified the updates since the earlier automated pass:
One residual finding, pre-existing on main rather than introduced here: the OAuth callback success page in Core diagnosis confirmed against ClickUp API v2 behavior ( by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
|
Keeping this open on unique clickup HTML escape in main.py vs #13288 folder-lists; extra production so not CLOSE; DIRTY. I am not approving or merging this SHA. |
|
Closing because this is already on main (ClickUp folder lists are already walked). The keep is #13844. This head does not add a unique production file. |
|
Hey @Aj2280 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
Summary
get_all_lists()inplugins/omi-clickup-app/clickup_client.pyonly queriedGET /space/{space_id}/list, which in ClickUp API v2 exclusively returns folderless lists. Any lists created or organized inside folders were completely invisible to list fetching, preventing users from selecting them in the settings UI or routing tasks to them.This change:
get_folders()to queryGET /space/{space_id}/folderand retrieve all folders in a space.get_folder_lists()to retrieve lists for a specific folder if not already embedded.get_all_lists()to aggregate both folderless lists and folder-contained lists, properly formatted withfolder_name / list_namefor clear disambiguation.plugins/omi-clickup-app/test_clickup_client.pyand registersclickup-app-client-testsin.github/checks-manifest.yaml.Test plan
plugins/omi-clickup-app/test_clickup_client.py: 6 passed in 0.001s, asserting folderless and folder lists are both retrieved, and failure modes fail-closed to[].Failure-Class: none
Closes #13808