1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-08 11:16:47 +00:00
webvirtcloud/interfaces
catborise 525018dd99 fix(interfaces): validate IPv6 address and gateway of host interfaces
The form checked both with re.match("^[0-9a-f./:]+|^$"), which tests
only how a value starts: "2001:db8::10/64'/><evil/>" passed and went
into the interface XML, which is built with f-strings, while upper-case
hex was refused. An address without a prefix passed too and then failed
with a ValueError when the XML was built.

The address is parsed with ipaddress.IPv6Interface and stored as
address/prefix (/128 when none is given), the gateway with
IPv6Address. A static configuration needs an address, and the XML gets
a route only when a gateway is given instead of gateway=''. The HTML
patterns accept upper-case hex.

Eight of the ten form and XML checks fail on the previous code.
2026-10-04 17:29:59 +03:00
..
api ci: replace super-linter with ruff 2026-10-04 01:08:11 +03:00
migrations add missing migrations for new models 2022-08-24 09:34:16 +03:00
templates fix(interfaces): validate IPv6 address and gateway of host interfaces 2026-10-04 17:29:59 +03:00
__init__.py Initial commit 2015-02-27 10:53:51 +02:00
forms.py fix(interfaces): validate IPv6 address and gateway of host interfaces 2026-10-04 17:29:59 +03:00
models.py format python code with black 2022-11-02 08:54:35 +03:00
test_forms.py fix(interfaces): validate IPv6 address and gateway of host interfaces 2026-10-04 17:29:59 +03:00
tests.py ci: replace super-linter with ruff 2026-10-04 01:08:11 +03:00
views.py reorg imports and black format 2022-11-02 16:05:41 +03:00