Repository navigation
Conversation
b17074e to
f67b081
Compare
|
Thanks @Evos09 — this is a careful, well-scoped fix for #14247. I reviewed every changed file and ran the new suite ( Per-file notes:
One small residual, non-blocking: Leaving formal approval to a human maintainer since this is your first contribution to the repo — the change itself is verified and in good shape for merge consideration. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
|
Hi @Git-on-my-level, thank you for the feedback!
— Automated response via Evos09 dev bot |
|
Hey @Evos09 👋 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! |
|
Hi @kodjima33, thank you for the feedback!
— Automated response via Evos09 dev bot |
Summary & Rationale
Resolves #14247.
In
plugins/omi-ms365-app/services/, multiple service integration methods lacked defensive null guards, type validation, or clamp limits when ingesting responses from Microsoft Graph API:mail.py:_slim_messagefailed if the message dictionary was None or non-dict, or iffromlackedemailAddress. Recipient lists inread()andsend()assumed well-formed dict items, riskingTypeErroron nulltoRecipientsor malformed recipient entries.list_recentandsearchdid not clamp$toplimit or filter non-dict messages.sharepoint.py:_slim_itemexecuted"folder" in itwhich throwsTypeError: argument of type 'NoneType' is not iterableifitis None.list_recent_filesandsearch_filesdid not filter non-dict items or clamp$top.teams.py:list_recent_chatsandlist_my_teamsdid not guard against null or non-dict items invalue.send_chat_messageandcreate_online_meetingassumed dictionary responses and risked crashing on non-dict Graph payloads.calendar.py:_slim_eventdirectly traversed nested objects without verifying dictionary types.find_free_slotsindexed nesteds["meetingTimeSlot"]["start"]["dateTime"]without verifying keys or types, andlist_upcomingdid not guard against nullvalue.graph_client.py:resp.headers.get("Retry-After")was directly wrapped inint(), crashing on HTTP-date format headers (RFC 7231 / RFC 9110) or invalid strings.Changes Made
mail.py:_slim_message(m)with null/non-dict guards and safe extraction ofemailAddress._extract_recipients(recipients)helper ensuring safe list and dict traversal.limit = max(1, min(limit, 50))and filtered items withisinstance(m, dict)inlist_recentandsearch.read()against nullbody,toRecipients, andccRecipients.sharepoint.py:_slim_item(it)against None/non-dict inputs before checking"folder" in itand safemimeTypeextraction.limitand filtered non-dict entries inlist_recent_filesandsearch_files.teams.py:limitand filtered non-dict items inlist_recent_chatsandlist_my_teams.send_chat_messageandcreate_online_meetingagainst non-dict API responses.calendar.py:_slim_event(e)against non-dict events and safely extracted nestedstart,end,location,organizer, andonlineMeeting.list_upcomingagainst nullvalueand non-dict items.find_free_slotswith safe dictionary checks and verifiedstart/enddateTimepresence.graph_client.py:_parse_retry_after(header_val, default=2)supporting integer seconds, RFC 7231/9110 HTTP-dates, and invalid fallbacks.plugins/omi-ms365-app/test_services_hardening.pyrunning 16 tests covering all edge cases hermetically under standard library Python with zero external network dependencies.ms365-services-hardening-testsin.github/checks-manifest.yaml.Verification
python -m unittest plugins/omi-ms365-app/test_services_hardening.py:python .github/scripts/run_checks.py --lane local --check-id ms365-services-hardening-tests:python .github/scripts/test_run_checks.py:Bounty payout treasury:
0x7badCdA295Dd7113f374aEA1008e7d5870D48556(Base Mainnet)