fix(security): analytics.flisk.si sends no Permissions-Policy header, unlike readme and tools

Open Beginner friendly
#29 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript
Domain
backend, security

Research direction

Start by locating where the Worker assembles its shared response headers (the CSP mentioned in the issue is added there), likely in the request handler or a headers helper, and add Permissions-Policy: camera=(), microphone=(), geolocation=() to that set. Check how 404/error responses are built so the same header applies to them. Add tests asserting the header on GET / and on a 404, then run the existing test suite to confirm nothing regressed; done means the curl -sI check shows the header on both responses.

Written by the indexing model from the issue text.

Description

agents area: runtime automation chore cli consistency dependencies developer-experience difficulty: easy documentation enhancement good first issue help wanted hygiene json-output priority: P3 starters tests

Problem

https://analytics.flisk.si/ sends a Content-Security-Policy but no Permissions-Policy header. readme.flisk.si and tools.flisk.si send camera=(), microphone=(), geolocation=(). Without it, any script or frame that ever runs on the page may ask for those browser features.

Reproduce: curl -sI https://analytics.flisk.si/ | grep -i permissions-policy prints nothing.

Root Cause Analysis

The security header set the app adds on responses includes CSP but leaves out Permissions-Policy.

TDD Fix Plan

  1. RED: Add a test that GET / returns a Permissions-Policy header that disables camera, microphone and geolocation.
    GREEN: Add the header to the shared response header set.
  2. RED: Add a test that the header is also present on 404 responses.
    GREEN: Apply the header set to error responses too.

REFACTOR: Share one header helper with the other flisk.si sites.

Acceptance Criteria

  • Permissions-Policy is present on pages and 404 responses
  • Camera, microphone and geolocation are disabled
  • All new tests pass
  • Existing tests still pass
Dominant language
JavaScript
Stars
0
Forks
2
Avg merge
1h 33m
Merged PRs (30d)
7

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from flisk-sh/analytics

All issues in flisk-sh/analytics

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.