Giter Club home page Giter Club logo

security.txt-extension's Introduction

Security.txt Parser browser extension

What is this?

This is a free (libre) browser extension. It should work on Chrome, Firefox, and Opera. When you ask it to, it searches a website for its security.txt file and shows it to you in a pretty-ish way.

How to use / How does it work?

When you click on its icon, it'll check /.well-known/security.txt. If it doesn't give a good error code, it'll then check security.txt.

Once it's done that, it checks whether the origin changed. This would happen if the security.txt file redirected. If it has, it gives you a big warning.

Then, it lists each directive, together with their associated comments, and expands only the Contact: directive. It looks like this:

Screenshot of the extension in action

The error is there because the protocol changed from http to https, and this is considered a new origin.

How do I install it?

  • Firefox? Install it from Firefox Add-ons
  • Chrome? The Chrome Web Store requires you to be 18+ (which I'm not) and pay $5.00 in order to upload an extension. Instead, search "Load unpacked extension Chrome" in your favourite browser, and follow the instructions to take the source code in this repository and place it on Chrome.
  • Opera? Coming soon, but for now, search "Load unpacked extension" in your favourite browser, and follow the instructions to take the source code in this repository and place it in Opera.

Why does it need all those permissions?

Same origin policy means it needs access to make requests. This is because the little popout is in a seperate origin to the page you're currrently viewing.

What happens if the security.txt file is malformed?

It will show you just the raw text if it finds an invalid line.

I've found a security issue in this extension.

Email me at jokebookyeye [ at symbol ] gmail [dot] com.

javascript: schemes in Contact fields are not vulnerabilities, so long as they open in a new tab. If you disagree, or are unsure, feel free to get in touch!

security.txt-extension's People

Contributors

joker314 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

benahmed-cyber

security.txt-extension's Issues

Render security.txt files in a pretty way

  • When you click on the extension icon, the pop-out should have an HTML version of the security.txt file
  • When you navigate directly to a security.txt file, the extension should hijack it into an HTML version.

Example:

<details>
  <summary>Contact</summary>
  <ul>
    <li><a href="mailto:[email protected]"><img src="mail.png" alt="Email:">[email protected]</a></li>
    <li><a href="tel:+123456789"><img src="phone.png" alt="Telephone:">+123456789</a></li>
</ul>
</details>
  • If the directive Permission: none is set, it must be placed clearly at the top, in red. If the Permission is set, but does not have a value of none, then this security.txt file is not spec-compliant. At the top, it should be in YELLOW and specify it's value. Let's also have a warning label (โš ๏ธ) for good measure
  • Contact must be expanded by default
  • Make clear note that signatures are not verified.

Give "hanging" comments a details element to reside in

Comments at the end of a security.txt file cannot be associated with a directive. Currently, they are just dumped onto the end. This could have minor security implications if the comment was Submit vulnerability information from the last few days in one place: https://evil.example.com.

Create a parser for security.txt files

  • Splits by \n and trims
  • Joins same directives (case-insensitive) into arrays
  • Adds comment field for all comments directly before. Spec is ambiguous, but empty lines should probably be stripped when deciding whether a sequence of comments is "directly" before a directive.
  • Force directive names to lowercase on output

Example output:

{
  "contact": {
    "comment": "I am incredibly busy\nBut I'll try my best, so please be patient!",
    "values": ["mailto:[email protected]"]
  },
  "encryption": { ... }
}

GH files: readme/contributing/licence/etc.

  • README should contain
    • How to install
      • Including manually?
    • What it looks like
      • Screenshots
    • How to use
      • Click a button
      • Do not trust the file until you've verified the signature
  • Licence
    • I want it to be free, both as in freedom and price. Freedom: people might want to personalise it. But also, freedom...; price: security is important. Putting money into things is annoying and not useful.
  • Contributing
    • Search for issues
  • Code of conduct
  • Issue template
  • No pull request template

Detect Content-Type of text/plain and warn users if a 200 status code appeared but wasn't text/plain

This is a problem with GitHub, it does not have a /.well-known/security.txt. However, /security.txt (as well as /security, /security.png, /security.html, etc.) all redirect to GitHub's help article on security.

The /.well-known/security.txt position was chosen to avoid name collisions. But if it isn't available for technical reasons, the root directory is fine too.

I guess we should show Content-Type/html in an iframe -- but this is hard if X-Frame-Options is set to deny.

Whitelist directive fields

Currently, if a line which does not contain a colon is encountered, the parser will add it to an error log, and eventually the extension will choose not to parse it.

If you see a URL, like http://example.com, this contains a colon, and so will be allowed through -- even if it has no valid field!

So, whitelist and error as per the spec.

Verify protections work

Verify that my defenses against

  • XSS
  • window.opener
    are effective.

Also, look at the accessibility of not providing an href attribute, and fix it.

Verify signatures

Verify that the security.txt file though the signature directive.

Create an icon

To make the extension look pretty, it needs an icon. Ideally, the icon would clearly convey the extension's purpose, and also be distinct from other extensions that are likely also installed on a user's machine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.