Open Bug 1566558 Opened 7 years ago Updated 6 years ago

be more careful about integer type sizes in nsSiteSecurityService

Categories

(Core :: Security: PSM, defect, P2)

defect

Tracking

()

People

(Reporter: keeler, Unassigned)

Details

(Whiteboard: [psm-backlog])

There's at least one unsound integer type conversion in nsSiteSecurityService (parsing max-age out of HSTS headers). This shouldn't be a security issue because we only accept HSTS headers from sites that have a valid certificate (and if a site wanted to disable HSTS for itself, it could just send a header with "max-age=0"), but we should still make sure we're making sound conversions (or not converting, if we don't need to).

Due to possible wrap around (arithmetic overflow) when converting seconds->milliseconds the max-age actually used is the value provided modulo UINT64_MAX/1000 (18,446,744,073,709 seconds = 584,942 years).

If a site provides a very large max-age (larger than this value), the issue is that the HSTS entry may unexpectedly time out after a very short time instead.

It is a minor issue, in an unlikely scenario.

Severity: normal → S4
You need to log in before you can comment on or make changes to this bug.