Skip to content

Restrict dunder path access on objects - #244

Merged
dgilland merged 2 commits into
dgilland:developfrom
gaoflow:fix-restricted-dunder-keys-240
Jul 6, 2026
Merged

Restrict dunder path access on objects#244
dgilland merged 2 commits into
dgilland:developfrom
gaoflow:fix-restricted-dunder-keys-240

Conversation

@gaoflow

@gaoflow gaoflow commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • restore object path restrictions from a two-key denylist to any dunder key
  • add __class__ coverage for get/invoke and a set_ regression test for class attribute pollution
  • keep dict/list path access behavior unchanged for matching string keys

Tests

  • PYTHONPATH=src python -m pytest tests/test_objects.py -k "restricted or test_set__raises" --no-cov
  • PYTHONPATH=src python -m pytest tests/test_*.py -o addopts=""
  • python -m ruff check src/pydash/helpers.py
  • git diff --check

Notes

  • PYTHONPATH=src python -m pytest --no-cov is not the primary local verification because the default pytest config collects tasks.py without the optional dev dependency invoke, and collects mypy-testing files without enabling their plugin mode.

Closes #240

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 100.0%. remained the same — gaoflow:fix-restricted-dunder-keys-240 into dgilland:develop

@dgilland
dgilland merged commit bc60f4c into dgilland:develop Jul 6, 2026
12 checks passed
@dgilland

dgilland commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Thanks for the contribution, much appreciated! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security: pydash RESTRICTED_KEYS Regression via __class__ Traversal

3 participants