Skip to content

Commit f578d2f

Browse files
committed
Bump version to 3.3.7 and improve URL safety
Updated version references to 3.3.7 across the project. Enhanced _is_safe_url in app.py to better prevent unsafe redirects by handling backslashes and stricter path validation.
1 parent c34fc7c commit f578d2f

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.3.2-3.3.7] - 2025-10-21
9+
10+
fixes and improvements since 3.3.1
11+
812
## [3.3.1] - 2025-10-18
913

1014
### Changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ ttsfm = "ttsfm.cli:main"
8686
version_scheme = "no-guess-dev"
8787
local_scheme = "no-local-version"
8888

89-
fallback_version = "3.3.4"
89+
fallback_version = "3.3.7"
9090
[tool.setuptools]
9191
packages = ["ttsfm"]
9292

ttsfm-web/app.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,14 @@ def _is_safe_url(target: Optional[str]) -> bool:
295295
if not target:
296296
return False
297297

298+
# Replace backslashes to prevent bypass (browsers accept \ as /)
299+
target = target.replace("\\", "")
300+
298301
parsed = urlparse(target)
302+
# Reject if scheme or netloc is present, or if it starts with //
299303
if parsed.scheme or parsed.netloc or target.startswith("//"):
300304
return False
305+
# Only allow paths starting with /
301306
if not parsed.path.startswith("/"):
302307
return False
303308
joined = urljoin(request.host_url, target)
@@ -763,7 +768,7 @@ def get_status():
763768
{
764769
"status": "online",
765770
"tts_service": "openai.fm (free)",
766-
"package_version": "3.3.1",
771+
"package_version": "3.3.7",
767772
"timestamp": datetime.now().isoformat(),
768773
}
769774
)
@@ -787,7 +792,7 @@ def get_status():
787792
def health_check():
788793
"""Simple health check endpoint."""
789794
return jsonify(
790-
{"status": "healthy", "package_version": "3.3.4", "timestamp": datetime.now().isoformat()}
795+
{"status": "healthy", "package_version": "3.3.7", "timestamp": datetime.now().isoformat()}
791796
)
792797

793798

ttsfm-web/templates/base.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
<a class="navbar-brand" href="{{ url_for('index') }}">
8989
<i class="fas fa-microphone-alt me-2"></i>
9090
<span class="fw-bold">TTSFM</span>
91-
<span class="badge bg-primary ms-2 small">v3.3.4</span>
91+
<span class="badge bg-primary ms-2 small">v3.3.7</span>
9292
</a>
9393

9494
<button class="navbar-toggler border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
@@ -159,7 +159,7 @@
159159
<div class="d-flex align-items-center">
160160
<i class="fas fa-microphone-alt me-2 text-primary"></i>
161161
<strong class="text-dark">TTSFM</strong>
162-
<span class="ms-2 text-muted">v3.3.4</span>
162+
<span class="ms-2 text-muted">v3.3.7</span>
163163
</div>
164164
</div>
165165
<div class="col-md-6 text-md-end">

ttsfm/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
)
6363
from .utils import split_text_by_length, validate_text_length
6464

65-
__version__ = "3.3.4"
65+
__version__ = "3.3.7"
6666
__author__ = "dbcccc"
6767
__email__ = "[email protected]"
6868
__description__ = "Text-to-Speech API Client with OpenAI compatibility"

0 commit comments

Comments
 (0)