File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -358,6 +358,10 @@ Set implementation-specific option. The following options are available:
358358 -X frozen_modules=[on|off]: whether or not frozen modules should be used.
359359 The default is "on" (or "off" if you are running a local build).
360360
361+ -X int_max_str_digits=number: limit the size of int<->str conversions.
362+ This helps avoid denial of service attacks when parsing untrusted data.
363+ The default is sys.int_info.default_max_str_digits. 0 disables.
364+
361365.TP
362366.B \- x
363367Skip the first line of the source. This is intended for a DOS
@@ -531,6 +535,11 @@ values.
531535
532536The integer must be a decimal number in the range [0,4294967295]. Specifying
533537the value 0 will disable hash randomization.
538+ .IP PYTHONINTMAXSTRDIGITS
539+ Limit the maximum digit characters in an int value
540+ when converting from a string and when converting an int back to a str.
541+ A value of 0 disables the limit. Conversions to or from bases 2, 4, 8,
542+ 16, and 32 are never limited.
534543.IP PYTHONMALLOC
535544Set the Python memory allocators and/or install debug hooks. The available
536545memory allocators are
Original file line number Diff line number Diff line change @@ -180,6 +180,8 @@ static const char usage_envvars[] =
180180"PYTHONDEBUG : enable parser debug mode (-d)\n"
181181"PYTHONDONTWRITEBYTECODE : don't write .pyc files (-B)\n"
182182"PYTHONINSPECT : inspect interactively after running script (-i)\n"
183+ "PYTHONINTMAXSTRDIGITS : limit max digit characters in an int value\n"
184+ " (-X int_max_str_digits=number)\n"
183185"PYTHONNOUSERSITE : disable user site directory (-s)\n"
184186"PYTHONOPTIMIZE : enable level 1 optimizations (-O)\n"
185187"PYTHONUNBUFFERED : disable stdout/stderr buffering (-u)\n"
You can’t perform that action at this time.
0 commit comments