diff --git a/src/RestrictedPython/transformer.py b/src/RestrictedPython/transformer.py
index c518ffc..faf45da 100644
--- a/src/RestrictedPython/transformer.py
+++ b/src/RestrictedPython/transformer.py
@@ -70,6 +70,7 @@ ALLOWED_FUNC_NAMES = frozenset([
 FORBIDDEN_FUNC_NAMES = frozenset([
     'print',
     'printed',
+    'builtins',
 ])
 
 

Python 3: builtins instead of __builtins__
As Python 3 has renames `__builtins__` to `builtins` the access to this system dictionary is not restricted by default
diff --git a/tests/test_Guards.py b/tests/test_Guards.py
index 8f1014a..c933d2f 100644
--- a/tests/test_Guards.py
+++ b/tests/test_Guards.py
@@ -1,7 +1,9 @@
 from RestrictedPython._compat import IS_PY2
+from RestrictedPython._compat import IS_PY3
 from RestrictedPython.Guards import guarded_unpack_sequence
 from RestrictedPython.Guards import safe_builtins
 from RestrictedPython.Guards import safer_getattr
+from tests import c_exec
 from tests import e_eval
 from tests import e_exec
 
@@ -214,3 +216,28 @@ def test_Guards__safer_getattr__3(e_exec):
     )
     e_exec(SAFER_GETATTR_ALLOWED, restricted_globals)
     assert restricted_globals['result'] == 2
+
+
+@pytest.mark.skipif(
+    IS_PY2,
+    reason="__builtins__ has been renamed in Python3 to builtins, "
+    "and need only to be tested there."
+)
+@pytest.mark.parametrize(*c_exec)
+def test_call_py3_builtins(c_exec):
+    """It should not be allowed to access global builtins in Python3."""
+    result = c_exec('builtins["getattr"]')
+    assert result.code is None
+    assert result.errors == ('Line 1: "builtins" is a reserved name.',)
+
+
+@pytest.mark.skipif(
+    IS_PY3,
+    reason="__builtins__ has been renamed in Python3 to builtins."
+)
+@pytest.mark.parametrize(*c_exec)
+def test_call_py2_builtins(c_exec):
+    """It should not be allowed to access global __builtins__ in Python2."""
+    result = c_exec('__builtins__["getattr"]')
+    assert result.code is None
+    assert result.errors == ('Line 1: "__builtins__" is an invalid variable name because it starts with "_"',)  # NOQA: E501
diff --git a/tests/test_imports.py b/tests/test_imports.py
index 79cd9e6..5d18bd6 100644
--- a/tests/test_imports.py
+++ b/tests/test_imports.py
@@ -3,6 +3,9 @@ Tests about imports
 """
 
 from RestrictedPython import safe_builtins
+from RestrictedPython._compat import IS_PY2
+from RestrictedPython._compat import IS_PY3
+from tests import c_exec
 from tests import e_exec
 
 import pytest
@@ -29,3 +32,92 @@ def test_os_import(e_exec):
     with pytest.raises(ImportError) as err:
         e_exec(OS_IMPORT_EXAMPLE, glb)
     assert '__import__ not found' == str(err.value)
+
+
+__BUILTINS_EXAMPLE = """
+import __builtins__
+
+mygetattr = __builtins__['getattr']
+"""
+
+
+@pytest.mark.skipif(
+    IS_PY3,
+    reason="__builtins__ has been renamed in Python3 to builtins, "
+    "so no __builtins__ in Python3."
+)
+@pytest.mark.parametrize(*c_exec)
+def test_import_py2_builtins(c_exec):
+    """It should not be allowed to access global __builtins__ in Python2."""
+    result = c_exec(__BUILTINS_EXAMPLE)
+    assert result.code is None
+    assert result.errors == (
+        'Line 2: "__builtins__" is an invalid variable name because it starts with "_"',  # NOQA: E501
+        'Line 4: "__builtins__" is an invalid variable name because it starts with "_"'  # NOQA: E501
+    )
+
+
+__BUILTINS_AS_EXAMPLE = """
+import __builtins__ as builtins
+
+mygetattr = builtins['getattr']
+"""
+
+
+@pytest.mark.skipif(
+    IS_PY3,
+    reason="__builtins__ has been renamed in Python3 to builtins, "
+    "so no __builtins__ in Python3."
+)
+@pytest.mark.parametrize(*c_exec)
+def test_import_py2_as_builtins(c_exec):
+    """It should not be allowed to access global __builtins__ in Python2."""
+    result = c_exec(__BUILTINS_EXAMPLE)
+    assert result.code is None
+    assert result.errors == (
+        'Line 2: "__builtins__" is an invalid variable name because it starts with "_"',  # NOQA: E501
+        'Line 4: "__builtins__" is an invalid variable name because it starts with "_"'  # NOQA: E501
+    )
+
+
+BUILTINS_EXAMPLE = """
+import builtins
+
+mygetattr = builtins['getattr']
+"""
+
+
+@pytest.mark.skipif(
+    IS_PY2,
+    reason="__builtins__ has been renamed in Python3 to builtins, "
+    "and need only to be tested there."
+)
+@pytest.mark.parametrize(*c_exec)
+def test_import_py3_builtins(c_exec):
+    """It should not be allowed to access global builtins in Python3."""
+    result = c_exec(BUILTINS_EXAMPLE)
+    assert result.code is None
+    assert result.errors == (
+        'Line 2: "builtins" is a reserved name.',
+        'Line 4: "builtins" is a reserved name.'
+    )
+
+
+BUILTINS_AS_EXAMPLE = """
+import builtins as glb
+
+mygetattr = glb['getattr']
+"""
+
+
+@pytest.mark.skipif(
+    IS_PY2,
+    reason="__builtins__ has been renamed in Python3 to builtins, "
+    "and need only to be tested there."
+)
+@pytest.mark.parametrize(*c_exec)
+def test_import_py3_as_builtins(c_exec):
+    """It should not be allowed to access global builtins in Python3."""
+    result = c_exec(BUILTINS_AS_EXAMPLE)
+    assert result.code is None
+    assert result.errors == ('Line 2: "builtins" is a reserved name.',)

pip install -e .[develop,test]
parse_log_pytest
pytest
pytest pytest-cov pytest-remove-stale-bytecode pytest-html
3.6
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs @ file:///opt/conda/conda-bld/attrs_1642510447205/work
certifi==2021.5.30
coverage==6.2
importlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1631916693255/work
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
more-itertools @ file:///tmp/build/80754af9/more-itertools_1637733554872/work
packaging @ file:///tmp/build/80754af9/packaging_1637314298585/work
pluggy @ file:///tmp/build/80754af9/pluggy_1615976315926/work
py @ file:///opt/conda/conda-bld/py_1644396412707/work
pyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work
pytest==6.2.4
pytest-cov==4.0.0
pytest-html==3.2.0
pytest-metadata==1.11.0
pytest-mock==3.6.1
pytest-remove-stale-bytecode==5.0.1
-e git+https://github.com/zopefoundation/RestrictedPython.git@ebe4c64f56a38f2ef39c14606517781af115a51f#egg=RestrictedPython
toml @ file:///tmp/build/80754af9/toml_1616166611790/work
tomli==1.2.3
typing_extensions @ file:///opt/conda/conda-bld/typing_extensions_1647553014482/work
zipp @ file:///tmp/build/80754af9/zipp_1633618647012/work

name: RestrictedPython
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - attrs=21.4.0=pyhd3eb1b0_0
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - importlib-metadata=4.8.1=py36h06a4308_0
  - importlib_metadata=4.8.1=hd3eb1b0_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - more-itertools=8.12.0=pyhd3eb1b0_0
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - packaging=21.3=pyhd3eb1b0_0
  - pip=21.2.2=py36h06a4308_0
  - pluggy=0.13.1=py36h06a4308_0
  - py=1.11.0=pyhd3eb1b0_0
  - pyparsing=3.0.4=pyhd3eb1b0_0
  - pytest=6.2.4=py36h06a4308_2
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - toml=0.10.2=pyhd3eb1b0_0
  - typing_extensions=4.1.1=pyh06a4308_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zipp=3.6.0=pyhd3eb1b0_0
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - coverage==6.2
      - pytest-cov==4.0.0
      - pytest-html==3.2.0
      - pytest-metadata==1.11.0
      - pytest-mock==3.6.1
      - pytest-remove-stale-bytecode==5.0.1
      - tomli==1.2.3
prefix: /opt/conda/envs/RestrictedPython

tests/test_Guards.py::test_call_py3_builtins[compile_restricted_exec] tests/test_imports.py::test_import_py3_builtins[compile_restricted_exec] tests/test_imports.py::test_import_py3_as_builtins[compile_restricted_exec]
tests/test_Guards.py::test_Guards__safe_builtins__1[_eval] tests/test_Guards.py::test_Guards__safe_builtins__2[_exec] tests/test_Guards.py::test_Guards__guarded_setattr__1[_exec] tests/test_Guards.py::test_Guards__write_wrapper__1[_exec] tests/test_Guards.py::test_Guards__write_wrapper__2[_exec] tests/test_Guards.py::test_Guards__guarded_unpack_sequence__1[_exec] tests/test_Guards.py::test_Guards__safer_getattr__1[_exec] tests/test_Guards.py::test_Guards__safer_getattr__2[_exec] tests/test_Guards.py::test_Guards__safer_getattr__3[_exec] tests/test_imports.py::test_os_import[_exec]
src/RestrictedPython/transformer.py
src/RestrictedPython/transformer.py