mediar-ai / screenpipe

rewind.ai x cursor.com = your AI assistant that has all the context. 24/7 screen & voice recording for the age of super intelligence. get your data ready or be left behind
https://screenpi.pe
MIT License
9.6k stars 559 forks source link

[bounty] fix security css #662

Open louis030195 opened 1 week ago

louis030195 commented 1 week ago

606

anyone help fix this, somehow the CSS security thing does not pass

re-enable the search sidebar https://github.com/mediar-ai/screenpipe/commit/99196605eed921d44bb9b055fa4e2c85b3fb45f2

and somehow fix the issue of security which only happens when doing

bun tauri build

and not in bun tauri dev

you need to tweak the tauri.config.json security rules somehow check #606

/bounty 50

linear[bot] commented 1 week ago

MED-271 [bounty]

algora-pbc[bot] commented 1 week ago

💎 $50 bounty • Screenpi.pe

Steps to solve:

  1. Start working: Comment /attempt #662 with your implementation plan
  2. Submit work: Create a pull request including /claim #662 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to mediar-ai/screenpipe!

Add a bounty • Share on socials

Attempt Started (GMT+0) Solution
🟢 @harshtech123 Nov 10, 2024, 5:09:59 AM WIP
🟢 @ologbonowiwi Nov 11, 2024, 6:21:15 PM WIP
🟢 @Dhruv80576 Nov 13, 2024, 4:26:28 PM WIP
harshtech123 commented 1 week ago

/attempt #662

tribhuwan-kumar commented 1 week ago
  • there is also a radix ui warning
    
    `DialogContent` requires a `DialogTitle` for the component to be accessible for screen reader users.

If you want to hide the DialogTitle, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/dialog

putting this will fix this:

```typescript
          <DialogTitle className="text-2xl font-bold">
            Changelog
          </DialogTitle>

here: https://github.com/mediar-ai/screenpipe/blob/574a970721098adaf533f3ae26557b5ef05b99e7/screenpipe-app-tauri/components/changelog-dialog.tsx#L29

Check the render method of SlotClone.

harshtech123 commented 1 week ago

[@louis030195]

i identified the issue and found following causes and fixes to do

"security": {
  "assetProtocol": {
    "enable": false
  },
  "csp": {
    "default-src": "'self' customprotocol: asset:",
    "connect-src": "ipc: http://ipc.localhost https://youtube.com https://api.openai.com http://localhost:3030 https://web.crabnebula.cloud https://api.github.com https://eu.i.posthog.com https://github.com https://*.githubusercontent.com https://*.github.com http://*:11434 http://*:9000 https://ai-proxy.i-f9f.workers.dev *",
    "font-src": [
      "https://fonts.gstatic.com",
      "tauri://localhost",
      "http://tauri.localhost"
    ],
    "media-src": "'self' mediadevices: asset: http://asset.localhost file: blob: tauri://localhost file: blob: https://youtube.com https://github.com https://youtu.be",
    "img-src": "'self' asset: http://asset.localhost blob: data: https://*.githubusercontent.com https://*.github.com https://github.com https://*.s3.amazonaws.com",
    "style-src": [
      "'unsafe-inline'",          // Allows inline styles
      "'self'",                   // Restricts to same origin
      "https://fonts.googleapis.com",  // Allows Google Fonts
      "tauri://localhost",
      "http://tauri.localhost",
      "http://localhost:*",
      "data:",                    // Allows data URIs
      "*"
    ],
    "frame-src": "https://www.youtube.com http://localhost:*"
  }
}

this may bypass the current security check

  • 'unsafe-inline': Allows inline styles, essential for apps using styles directly in HTML elements.

  • 'self': Restricts external loading to only from the app’s origin.

  • https://fonts.googleapis.com: Explicitly permits loading styles from google Fonts.

  • Wildcard (*) in style-src: Be cautious, as it may allow any source, potentially opening security risks.

louis030195 commented 1 week ago

send a PR that show it's fixed

i don't accept chatgpt answer, just fix it

ologbonowiwi commented 1 week ago

/attempt #662

Algora profile Completed bounties Tech Active attempts Options
@ologbonowiwi    3 mediar-ai bounties
+ 53 bounties from 7 projects
Rust, TypeScript,
Shell & more
Cancel attempt
Dhruv80576 commented 1 week ago

/attempt #662