Skip to content

Fix/various fixes - #43

Merged
lchoquel merged 11 commits into
devfrom
fix/Various-fixes
Oct 4, 2025
Merged

lchoquel merged 11 commits into
devfrom
fix/Various-fixes

Conversation

@lchoquel

@lchoquel lchoquel commented Jul 13, 2025 •

Copy link
Copy Markdown
Member

🚀 New Features

📝 Changes

🔒 Security

  • Documentation: Added security considerations section to README regarding deserializing untrusted JSON data

@bpietropaoli bpietropaoli left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I haven't looked at the .github modifications since it's your repo and you manage it however you want.

As for the issues mentioned, there are solved. Good work. :)

Comment thread README.md
Comment on lines +187 to +197
## ⚠️ Security Considerations

**Warning**: Instantiating classes using `__class__` and `__module__` attributes poses a security threat when deserializing untrusted JSON data. Malicious JSON could potentially instantiate arbitrary classes and execute code.

Only use Kajson to deserialize JSON from trusted sources. For untrusted data, consider:
- Validating JSON structure before deserialization
- Using a whitelist of allowed classes
- Sanitizing input data

For more discussion on this topic, see [this discussion thread](https://github.com/Pipelex/kajson/discussions/44).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A necessary addition for sure, informing potentially careless users is always a good idea. :)

Comment thread kajson/json_encoder.py

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good, cleaning unused code is just good practice for maintainability.

Comment thread kajson/json_encoder.py
Comment on lines +216 to +220
# Expressions used to find module names (compiled once at import time):
__class_expression = re.compile(r"^<class '([a-zA-Z0-9._]*)'>")
__type_expression = re.compile(r"^<type '([a-zA-Z0-9._]*)'>")


Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Definitely in its right place now. ;)

Comment thread docs/pages/api/manager.md

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I would have added docstrings in the code itself so tools like Intellisense in VSCode can give you the doc on the fly too but at least it's documented. :)

@lchoquel
lchoquel merged commit 7b32a38 into dev Oct 4, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 4, 2025
@lchoquel
lchoquel deleted the fix/Various-fixes branch March 26, 2026 01:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants