Skip to content

fix: map the polite aggression level to a level WhatWeb accepts - #14

Open
Uzair-Ahmed-Dahraj wants to merge 1 commit into
devkindhq:mainfrom
Uzair-Ahmed-Dahraj:fix/polite-aggression-level
Open

Uzair-Ahmed-Dahraj wants to merge 1 commit into
devkindhq:mainfrom
Uzair-Ahmed-Dahraj:fix/polite-aggression-level

Conversation

@Uzair-Ahmed-Dahraj

Copy link
Copy Markdown
Collaborator

Problem

whatweb_scan offers five aggression names. The name polite maps to WhatWeb level 2. WhatWeb 0.6.4, the version the Dockerfile pins, accepts only levels 1, 3 and 4:

raise "Agression level must be 1,3, or 4. #{arg} is invalid." unless [1, 3, 4].include? arg.to_i

Source: line 505 of whatweb at tag v0.6.4.

Impact

Each scan with aggression: "polite" fails. The tool schema lists polite as a valid value, so an agent can select it.

Fix

  • server.py: polite maps to level 1, the one-request level. The name stays in the schema, so a client that sends polite keeps working.
  • tests/test_aggression.py: a test that each name maps to a level WhatWeb accepts.
  • README.md: the level line now shows stealthy/passive/polite as level 1.
  • server.json: version and the image tag move from 1.0.1 to 1.0.2. Tag v1.0.1 exists on an older commit, and the release workflow needs the tag to equal server.json. A release of this fix needs tag v1.0.2.

Example

Call Before After
whatweb_scan with aggression: "polite" runs whatweb -a 2, which WhatWeb rejects runs whatweb -a 1

Verification

  • The new test with the old map: 1 failed, on [polite]. With the fix: 25 passed.
  • jq on server.json: version is 1.0.2 and the identifier is docker.io/devkind/whatweb-mcp:1.0.2.
  • git apply --check of the diff of docs: add a privacy policy for the plugin directory #13 passes on top of this branch, so the two pull requests do not conflict.

Review Notes

  • .claude-plugin/plugin.json stays at 1.1.1. No plugin file changes here: the fix is in the server image.
  • README.md line 7 still says "five aggression levels". Five names exist, and three of them now give level 1. The line is not changed here.
  • Docker Hub latest is still the 1.0.0 image. The fix reaches users only after a release, and the release needs the DOCKERHUB_USERNAME and DOCKERHUB_TOKEN repository secrets.
  • The repo has no CI workflow on main, so the tests do not run on this pull request. They ran locally.

WhatWeb 0.6.4 accepts only levels 1, 3 and 4, so each polite scan failed. server.json moves to 1.0.2 so that a new release tag is possible.

@superkindhq superkindhq Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified clean at head 5fb2776 (4 files, +18/-4). Repo has no CI, so this local run is the gate.

Aggression mapping verified against upstream source. WhatWeb v0.6.4 (the exact version the Dockerfile clones) raises "Agression level must be 1,3, or 4. #{arg} is invalid." for anything outside [1,3,4] — see https://github.com/urbanadventurer/WhatWeb/blob/v0.6.4/whatweb, option-parsing around -a/--aggression. So the old "polite": 2 made every polite scan die with a Ruby exception. The fix ("polite": 1) is correct, the inline comment explains it, and the remaining levels (stealthy:1, passive:1, normal:3, aggressive:4) are all valid. README mapping line updated to match.

Local test suite on this head: 25 passed, 0 failed, 2 warnings in 2.47s (Python 3.12.3, exact pins mcp 1.28.1 / pydantic 2.11.5 / pydantic-settings 2.9.1; the new tests/test_aggression.py contributes 5 parametrized cases). Note: pins do not resolve on Python ≥3.14 where mcp 1.28.1 requires pydantic ≥2.12 — environment quirk, not a PR defect.

Merge compatibility with #13 — git merge-tree pr/13 pr/14 exits 0, clean; README edits touch different lines (155 vs 162-163) and both land in the merged tree.

Deployment note (non-blocking, merge-order nuance): server.json now references docker.io/devkind/whatweb-mcp:1.0.2, but Docker Hub currently has only 1.0.0 and latest (same digest). Registry consumers will pull-fail until the 1.0.2 image is pushed — push the image before/with merge, same cadence as 1.0.0 in #12. .claude-plugin/plugin.json stays at 1.1.1, which tracks the plugin manifest separately; consistent with how #13 bumps its own URL field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant