Skip to content

fix(nano): protect disabled builtin functions and fix oct#1363

Merged
glevco merged 1 commit intomasterfrom
fix/nano/custom-builtins
Aug 20, 2025
Merged

fix(nano): protect disabled builtin functions and fix oct#1363
glevco merged 1 commit intomasterfrom
fix/nano/custom-builtins

Conversation

@glevco
Copy link
Contributor

@glevco glevco commented Aug 15, 2025

Motivation

Improve security of custom builtins.

Acceptance Criteria

  • Improve disabled builtins function to reduce exposed properties by removing wrapping, adding slots, and making it FauxImmutable.
  • Unify list of disabled builtins and AST name blacklist so they don't drift apart.
  • Fix oct typo, it was incorrectly pointing to object.
  • Move the following builtins from allowed to disabled, as they're not necessary: False, None, True, NotImplemented, Ellipsis, __doc__, __loader__, __package__, __spec__, complex.

Checklist

  • If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged

@glevco glevco self-assigned this Aug 15, 2025
@glevco glevco moved this from Todo to In Progress (WIP) in Hathor Network Aug 15, 2025
@github-actions
Copy link

github-actions bot commented Aug 15, 2025

🐰 Bencher Report

Branchfix/nano/custom-builtins
Testbedubuntu-22.04
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
minutes (m)
(Result Δ%)
Lower Boundary
minutes (m)
(Limit %)
Upper Boundary
minutes (m)
(Limit %)
sync-v2 (up to 20000 blocks)📈 view plot
🚷 view threshold
1.90 m
(+13.86%)Baseline: 1.66 m
1.50 m
(79.05%)
2.00 m
(94.88%)
🐰 View full continuous benchmarking report in Bencher

@glevco glevco force-pushed the fix/nano/custom-builtins branch from a70770c to a323770 Compare August 15, 2025 16:22
@glevco glevco moved this from In Progress (WIP) to In Progress (Done) in Hathor Network Aug 15, 2025
@glevco glevco force-pushed the fix/nano/custom-builtins branch 3 times, most recently from 7b72804 to 86a9986 Compare August 19, 2025 13:56
@glevco glevco changed the title fix(nano): protect disable builtin functions and fix oct fix(nano): protect disabled builtin functions and fix oct Aug 19, 2025
@glevco glevco force-pushed the fix/nano/custom-builtins branch 2 times, most recently from 5c590aa to fb2ff5b Compare August 19, 2025 14:37
@codecov
Copy link

codecov bot commented Aug 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.63%. Comparing base (3be193b) to head (1615b27).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1363      +/-   ##
==========================================
- Coverage   85.67%   85.63%   -0.05%     
==========================================
  Files         429      429              
  Lines       32439    32444       +5     
  Branches     5068     5068              
==========================================
- Hits        27793    27783      -10     
- Misses       3616     3628      +12     
- Partials     1030     1033       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

msbrogli
msbrogli previously approved these changes Aug 20, 2025
@glevco glevco force-pushed the fix/nano/custom-builtins branch 2 times, most recently from 7b85679 to 7645cae Compare August 20, 2025 14:57
@glevco glevco moved this from In Progress (Done) to In Review (WIP) in Hathor Network Aug 20, 2025
@glevco glevco moved this from In Review (WIP) to In Review (Done) in Hathor Network Aug 20, 2025
@github-project-automation github-project-automation bot moved this from In Review (Done) to In Review (WIP) in Hathor Network Aug 20, 2025
@glevco glevco force-pushed the fix/nano/custom-builtins branch from 7645cae to 1615b27 Compare August 20, 2025 20:17
@glevco glevco moved this from In Review (WIP) to In Review (Done) in Hathor Network Aug 20, 2025
@glevco glevco merged commit 786cf34 into master Aug 20, 2025
8 checks passed
@glevco glevco deleted the fix/nano/custom-builtins branch August 20, 2025 21:09
@github-project-automation github-project-automation bot moved this from In Review (Done) to Waiting to be deployed in Hathor Network Aug 20, 2025
@jansegre jansegre mentioned this pull request Sep 11, 2025
2 tasks
@jansegre jansegre moved this from Waiting to be deployed to Done in Hathor Network Sep 18, 2025
@jansegre jansegre mentioned this pull request Sep 24, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants