atlassian / atlassian/github-for-jira

Secure Headers are not in use

Open
#2,491 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
655
Forks
194
PR merge metrics
No merged PRs in 30d

Description

Was looking at the codebase for some stuff I've done in the past and [noticed this](https://github.com/atlassian/github-for-jira/blob/main/src/app.ts#L99):

```
setupFrontendApp(app);
secureHeaders(app);
```

Since it's using the express `use` concept, and that it's "using" _after the router is setup_, that means that all secure headers are essentially ignored until after the routes are completed, which means that this isn't securing anything.

I'm not sure what's being accomplished by having the security headers in a separate function since it's only used once? Why not just add it inline with all other express app settings _right before_ the router is used?

![skeletor-until-we-meet-again](https://github.com/atlassian/github-for-jira/assets/573668/a8a0b2ca-4402-4921-8173-d6277b36eaed)

Contributor guide

No contributing guide indexed for this repository

Research direction

The relevant middleware order is in src/app.ts around line 99; read how setupFrontendApp, secureHeaders, and the router are registered. Confirm secureHeaders is registered before route handling, then run the repository's existing checks to verify the security headers are applied.

Written by the indexing model from the issue text.

Assessment

Tech stack
express, typescript
Domain
backend, security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.