Skip to content

Conversation

@stainless-app
Copy link
Contributor

@stainless-app stainless-app bot commented Dec 9, 2025

Automated Release PR

2.4.0-rc1 (2026-01-12)

Full Changelog: v2.3.3-rc1...v2.4.0-rc1

Features

Bug Fixes

  • types: allow pyright to infer TypedDict types within SequenceNotStr (d1f6535)
  • use async_to_httpx_files in patch method (a6fbc3c)

Chores

  • add missing docstrings (a3c938c)
  • docs: use environment variables for authentication in code snippets (534af15)
  • internal: add --fix argument to lint script (4b3b067)
  • internal: add missing files argument to base client (9672ca2)
  • internal: codegen related update (ddab89d)
  • speedup initial import (4ae973c)
  • update lockfile (abd7b3d)

Documentation

  • prominently feature MCP server setup in root SDK readmes (8ed50d2)

This pull request is managed by Stainless's GitHub App.

The semver version number is based on included commit messages. Alternatively, you can manually set the version number in the title of this pull request.

For a better experience, it is recommended to use either rebase-merge or squash-merge when merging this pull request.

🔗 Stainless website
📚 Read the docs
🙋 Reach out for help or questions

@stainless-app stainless-app bot force-pushed the release-please--branches--main--changes--next branch from c5d4658 to 03828db Compare December 9, 2025 23:39
@pullrequest
Copy link

pullrequest bot commented Dec 9, 2025

HackerOne Code Security Review

🟢 Scan Complete: ✔️ No issues detected
🟢 Validation Complete: The engineer who manually reviewed the code found one or more things that may need attention.
🟠 Issue(s) Resolved: 0 / 2

*We want to surface issues only when necessary and actionable. If we didn't get something right, or if there's more context we should take into account, reply to the comment so we'll know for the future.

Here's how the code changes were interpreted and info about the tools used for scanning.

🧰 Analysis tools

⏱️ Latest scan covered changes up to commit 975f9e0 (latest)

@pullrequest
Copy link

pullrequest bot commented Dec 9, 2025

✅ Graham C reviewed all the included code changes and associated automation findings and determined that there were no immediately actionable security flaws. Note that they will continue to be notified of any new commits or comments and follow up as needed throughout the duration of this pull request's lifecycle.

Image of Graham C Graham C


Reviewed with ❤️ by PullRequest

@pullrequest
Copy link

pullrequest bot commented Dec 12, 2025

Graham C has submitted feedback.

Image of Graham C Graham C


Reviewed with ❤️ by PullRequest

class MessageContentMixedContentImageFragmentImageURL(TypedDict, total=False):
"""The image URL object containing the location of the image."""

url: Required[str]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The url field accepts any string without validation, creating a potential Server-Side Request Forgery (SSRF) vulnerability. This field can contain external URLs or base64-encoded data URIs. Without validation, an attacker could provide URLs to internal services (like http://localhost:6379 or cloud metadata endpoints at http://169.254.169.254/) that the server can access but external users cannot.

According to the OWASP Input Validation Cheat Sheet, URL inputs should validate: allowed protocols (typically only https:// for external URLs), that destinations are not private IP ranges or localhost, and maximum string length. For base64 data URIs, validate the decoded size to prevent memory exhaustion.

Remediation:

Add validation in the API handler before processing URLs:

  • Parse and verify scheme is https (or data for base64)
  • For https URLs, block localhost, private IPs (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 127.0.0.0/8)
  • Enforce max length (e.g., 10KB for URLs, 10MB for data URIs)
  • For data URIs, validate MIME type and decoded size

References:

🔸 Vulnerability (Warning)

Image of Graham C Graham C

class GraphToolFunction(BaseModel):
"""A tool that uses Knowledge Graphs as context for responses."""

graph_ids: List[str]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The graph_ids field accepts a list of strings without maximum length validation on either array size or individual elements. An attacker could provide an extremely large array or very long ID strings, leading to memory exhaustion and denial of service. When processing queries against specified graphs, this could also cause database performance issues.

The OWASP Input Validation Cheat Sheet states that array inputs must have maximum length validation to prevent resource exhaustion. Without bounds, attackers can force excessive memory allocation, iterate over unreasonable item counts, or construct database queries with massive IN clauses. Note that the TypedDict version in src/writerai/types/shared_params/tool_param.py has the same issue.

Remediation:

Add Pydantic field validators:

from pydantic import field_validator

@field_validator('graph_ids')
@classmethod
def validate_graph_ids(cls, v):
    if len(v) > 50:
        raise ValueError('graph_ids cannot exceed 50 items')
    for graph_id in v:
        if len(graph_id) > 256:
            raise ValueError('individual graph_id cannot exceed 256 characters')
    return v

References:

🔸 Vulnerability (Warning)

Image of Graham C Graham C

@stainless-app stainless-app bot force-pushed the release-please--branches--main--changes--next branch from 03828db to 565e903 Compare December 15, 2025 19:21
@stainless-app stainless-app bot force-pushed the release-please--branches--main--changes--next branch from 565e903 to 56ab08c Compare December 16, 2025 17:23
@stainless-app stainless-app bot force-pushed the release-please--branches--main--changes--next branch from 56ab08c to 8a5e0d0 Compare December 17, 2025 15:50
@stainless-app stainless-app bot force-pushed the release-please--branches--main--changes--next branch from 8a5e0d0 to 24004a4 Compare December 18, 2025 21:53
@pullrequest
Copy link

pullrequest bot commented Dec 27, 2025

PullRequest reviewed the updates made to #251 up until the latest commit (24004a4). No further issues were found.

Reviewed by:

Image of Graham C Graham C

@stainless-app stainless-app bot force-pushed the release-please--branches--main--changes--next branch from 24004a4 to aa2cbf0 Compare January 5, 2026 04:08
@stainless-app stainless-app bot force-pushed the release-please--branches--main--changes--next branch from aa2cbf0 to 4077eaa Compare January 5, 2026 20:52
@pullrequest
Copy link

pullrequest bot commented Jan 12, 2026

PullRequest reviewed the updates made to #251 up until the latest commit (4077eaa). No further issues were found.

Reviewed by:

Image of Graham C Graham C

Manually adding the default_retires config to the stainless config
@stainless-app stainless-app bot force-pushed the release-please--branches--main--changes--next branch from 4077eaa to ea02763 Compare January 12, 2026 18:40
@stainless-app stainless-app bot changed the title release: 2.3.3-rc2 release: 2.4.0-rc1 Jan 12, 2026
@stainless-app stainless-app bot force-pushed the release-please--branches--main--changes--next branch from ea02763 to 9682fc1 Compare January 12, 2026 18:40
Manually updated max_retries param
@stainless-app stainless-app bot force-pushed the release-please--branches--main--changes--next branch from 9682fc1 to 975f9e0 Compare January 12, 2026 22:01
@adeweaver adeweaver merged commit 7e885d4 into main Jan 12, 2026
11 checks passed
@stainless-app
Copy link
Contributor Author

stainless-app bot commented Jan 12, 2026

@adeweaver adeweaver deleted the release-please--branches--main--changes--next branch January 12, 2026 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants