Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@lchoquel
Copy link
Member

@lchoquel lchoquel commented Jul 13, 2025

πŸš€ New Features

πŸ“ Changes

πŸ”’ Security

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

Copy link

@bpietropaoli bpietropaoli left a comment

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 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).

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. :)

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 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._]*)'>")


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. ;)

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
16 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 4, 2025
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.

3 participants