Skip to content

Commit f62360b

Browse files
committed
docs: document security notes in SECURITY.md (v0.7.39)
Added notes on trusted config params (log_file, env_file), thread safety limitations, and user input in error messages.
1 parent 0b33664 commit f62360b

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

SECURITY.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,17 @@ Include:
2121
- Potential impact
2222

2323
You will receive a response within 48 hours.
24+
25+
## Security Notes
26+
27+
### Trusted configuration parameters
28+
29+
`log_file` and `env_file` are passed directly to `open()`. These are trusted configuration values set by the developer, not user input. Do not expose them to end users or accept them from untrusted sources.
30+
31+
### Thread safety
32+
33+
`KwtSMS` and `AsyncKwtSMS` instances are not thread-safe. Cached values (`_cached_balance`, `_cached_purchased`) are read and written without locks. In CPython, the GIL makes simple float assignment atomic in practice, but this is not guaranteed by the language spec. If sharing a client instance across threads, protect calls with your own lock.
34+
35+
### Error messages may contain user input
36+
37+
Validation error messages (e.g., `"'user@gmail.com' is an email address, not a phone number"`) include the raw input. This is safe in JSONL logs (JSON-encoded). If you display these messages in HTML, escape them first to prevent XSS.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "kwtsms"
3-
version = "0.7.38"
3+
version = "0.7.39"
44
description = "Python client for kwtSMS, the Kuwait SMS gateway trusted by top businesses to deliver messages worldwide, with private Sender ID, free API testing, and non-expiring credits."
55
readme = "README.md"
66
requires-python = ">=3.8"

src/kwtsms/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
__all__ = ["KwtSMS", "AsyncKwtSMS", "normalize_phone", "clean_message",
2727
"validate_phone_input", "parse_webhook",
2828
"find_country_code", "validate_phone_format"]
29-
__version__ = "0.7.38"
29+
__version__ = "0.7.39"

0 commit comments

Comments
 (0)