1
0
mirror of https://github.com/lancedikson/bowser synced 2026-09-23 04:24:54 +00:00
Commit Graph

54 Commits

Author SHA1 Message Date
naorpeled
982a91d5e8 fix: resolve open GitHub security findings
Code scanning (js/polynomial-redos, alerts #16 and #17)
-------------------------------------------------------
bowser applies these regexps to attacker-controlled User-Agent strings, and
four of them ran in quadratic time:

  * The "Something else" fallback used /^(.*)\/(.*) / and
    /^(.*)\/(.*)[ \t]\((.*)/. Two unbounded `.*` before a required literal
    make the split ambiguous, so a UA of "/a" repeated backtracks O(n^2).
    Greedy `(.*)` always picks the last `/` that still has the delimiter
    after it, so the second group can never span a `/` -- narrowing it to
    `[^/]*` is exactly equivalent and removes the ambiguity. Verified
    identical on 1,000,000 fuzzed inputs and on the full acceptance corpus.

  * The Linespider and SlackBot version regexps used `(?:-[-\w]+)?` before a
    required `[\s/]`. Since `[-\w]` and `[\s/]` are disjoint the backtracking
    is pure waste, but the engine still walks it once per start position, so
    "linespider-" repeated is quadratic. Bounding the run to `{1,64}` makes
    it linear; no real bot-name suffix approaches 64 characters.

A sweep of all 253 regexp literals in src/ (fuzzed for superlinear scaling,
with the four pre-fix patterns used to confirm the detector works) reports no
remaining superlinear regexps. test/unit/redos.js locks this in.

Actions (actions/missing-workflow-permissions, alerts #5 and #15)
-----------------------------------------------------------------
merge-to-master.yml and draft-or-update-next-release.yml had no `permissions`
block and so inherited the default token. Both now declare least privilege,
matching publish.yml and pull-request.yml.

Dependabot (22 open alerts, all development scope)
--------------------------------------------------
bowser ships no runtime dependencies, so none of these reached consumers, but
they were live in CI. `pnpm audit` goes from 29 advisories to 0:

  * jsdoc 3 -> 4 (with docdash 1 -> 2) drops taffydb, which has no patched
    release, and picks up current markdown-it/linkify-it.
  * coveralls -> coveralls-next 6 drops `request`, which is deprecated with no
    patched release, along with form-data, qs 6.5.x, uuid 3 and tough-cookie 2.
    Same `coveralls` bin and same stdin contract; lcov conversion verified.
  * gh-pages 3 -> 6 clears the critical prototype pollution advisory.
  * pnpm overrides pin the remaining transitive-only advisories to the lowest
    patched release on each existing major.

Verified: pnpm audit clean, lint clean, 346 tests pass (the acceptance corpus
runs against both src/ and the built es5.js), build, package smoke test, and
doc generation.
2026-08-30 21:00:59 +03:00
Jelle Raaijmakers
a37b8be8a7 feat: add Ladybird browser support (#627) 2026-07-31 12:10:10 +03:00
Swapnil Sahu
92b5639733 feat: add support for HeyTap Browser and Vivo Browser identification (#621) 2026-04-10 23:18:44 +07:00
Naor Peled
2c253c3ad2 fix: prevent Motorola Edge devices from being misidentified as Microsoft Edge (#612) 2026-03-14 16:17:53 +02:00
naorpeled
cf397a4b50 feat: add Vivaldi client hints support 2026-02-13 23:09:48 +02:00
Copilot
227f5ecd4b feat: add Brave browser support via clientHints (#597) 2026-02-07 18:29:20 +02:00
Jam Hsu
c09ff24ae1 feat: Add Line sipder detection (#600)
Co-authored-by: Jam <jam.hsu@lativ.com.tw>
2026-02-06 23:08:55 +02:00
Jonathan Kingston
aaa67db25e feat: add clientHints support + DuckDuckGo detection (#595) 2026-02-01 23:50:33 +02:00
Jam Hsu
74463f6b23 feat: Add Slack bot detection (#596)
Co-authored-by: Jam <jam.hsu@lativ.com.tw>
2026-01-31 18:54:09 +02:00
Naor Peled
4a6dacca08 feat: add Sogou browser support (#579)
Co-authored-by: 猫猫 <49067249+NotEvenANeko@users.noreply.github.com>
2025-11-22 23:31:31 +02:00
Copilot
be90a00e37 feat: add LibreWolf browser detection (#578)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: naorpeled <6171622+naorpeled@users.noreply.github.com>
2025-11-22 19:01:03 +02:00
Naor Peled
f7d2c0693c feat: add support for AI crawl bots (#577) 2025-11-22 18:05:08 +02:00
Lucio Martinez
771dfb2dfe feat: add more bot platforms (#542)
Co-authored-by: naorpeled <me@naor.dev>
2025-11-22 16:44:08 +02:00
Mehmet Akif Yücel
bb8f94efcd feat: add Pale Moon browser support (#495) 2023-11-17 20:47:16 +02:00
Will Soares
d5fe5657d1 feat(browser): add detection for Miui Browser 2020-08-23 13:58:07 -03:00
Denis Demchenko
725de76e14 Revert "chore(tests): fix tests for Firefox iOS"
This reverts commit 9edfabf9
2020-07-09 21:23:10 +03:00
Denis Demchenko
9edfabf98a chore(tests): fix tests for Firefox iOS
relevant to #401
2020-06-02 00:32:35 +03:00
Denis Demchenko
3813d92a55 feat(browser): add detection of Opera Touch
fixes #414
2020-06-02 00:16:43 +03:00
Farfurix
648daa5f9f Add Electron 2019-12-04 15:55:36 +03:00
Denis Demchenko
0ce5a8173a Merge pull request #363 from navarroaxel/feat/gsa
feat(browsers): Add Google Search App detection
2019-10-02 21:26:25 +03:00
Axel Navarro
e29357793a feat(browsers): Add Google Search App detection 2019-09-25 08:58:27 -03:00
Mathias Kahl
e57c3d99d5 support QQ Browser 2019-09-18 10:34:14 +02:00
Denis Demchenko
e1a37ef4fa Merge pull request #310 from ricardorauber/master
Update the regexp for generic browsers
2019-04-24 21:28:27 +03:00
Ricardo Rauber Pereira
b8d60f7593 fix regexp selection order 2019-04-23 10:40:04 +01:00
Ricardo Rauber Pereira
2dcfca1388 remove tabs 2019-04-23 10:28:11 +01:00
Ricardo Rauber Pereira
d0959a43c4 update the constant names 2019-04-23 10:15:02 +01:00
Ricardo Rauber Pereira
8e49696d02 update the comment 2019-04-23 10:13:52 +01:00
Ricardo Rauber Pereira
4d8c781369 updated the code to be more clear 2019-04-23 10:11:04 +01:00
Denis Demchenko
d596a43f6b Add support of the new Blink-based MS Edge
fixes #311
2019-04-14 13:39:35 +03:00
Denis Demchenko
428dadc503 Fix Yandex Browser version detection
fixes #308
2019-04-07 11:28:03 +03:00
Ricardo Rauber Pereira
cfe2b493bb Remove missing space at the end 2019-04-05 18:33:15 +01:00
Ricardo Rauber Pereira
3bfb24c8cb Updated the check for generic browsers 2019-04-05 18:18:39 +01:00
Ricardo Rauber Pereira
ba4783868d Update the regex for custom browsers 2019-04-05 17:43:04 +01:00
Denis Demchenko
134ef3c186 Fix bugs with Utils 2019-03-06 14:27:35 +02:00
rcohen-unext
383c627fc0 Add PlayStation 4 browser support 2019-03-06 14:19:34 +02:00
Nick Tipping
bf067ec992 Add file extensions to imports
Add ES6 style export to utils and change related utils imports
Update eslint rule for import extensions
2019-02-14 16:06:14 +00:00
Robert Sandell
1535c62b74 Added support for Googlebot recognition 2019-01-16 13:30:38 +02:00
ycjcl868
1ce9916b35 feat: wechat browser 2018-10-14 23:25:45 +08:00
Denis Demchenko
0a149bca7b Fix Chrome mobile detection
fixes #253
2018-09-14 17:44:17 +03:00
Denis Demchenko
3489f9d374 Support Swing browser
fixes #248
2018-09-09 15:07:40 +03:00
Julian Doucette
343b748986 Added maxthon desktop support 2018-08-29 22:44:50 +01:00
Denis Demchenko
8676817177 Catch up with last browsers in 1.9 version 2018-07-09 21:26:43 +03:00
Denis Demchenko
ad2589f699 Add eslint support 2017-12-20 23:29:06 +02:00
Denis Demchenko
778fdb6004 Add Microsoft Edge cases 2017-12-20 22:34:29 +02:00
Denis Demchenko
36db325c62 Fix browsers parser 2017-08-20 18:22:28 +03:00
Denis Demchenko
6976da7da5 Make versions of browsers non-required properties 2017-08-17 23:33:46 +03:00
Denis Demchenko
a794b10797 Add an engines parser 2017-06-09 23:04:43 +03:00
Denis Demchenko
39afeb5615 Replace OS version regexps by more greedy ones 2017-06-08 23:01:16 +03:00
Denis Demchenko
3cd9da66ae Add support of rendering engines 2017-06-08 22:34:58 +03:00
Denis Demchenko
8b37abf268 Change descriptors naming and add some information about them 2017-05-18 22:57:18 +03:00