Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: object injection not detected #112

Closed
1 task
FizzBuzz791 opened this issue Jan 16, 2023 · 2 comments
Closed
1 task

Bug: object injection not detected #112

FizzBuzz791 opened this issue Jan 16, 2023 · 2 comments
Labels

Comments

@FizzBuzz791
Copy link

What version of eslint-plugin-security are you using?

1.6.0

ESLint Environment

Node version: 16.19.0
npm version: 8.19.3
Local ESLint version: 8.0.1
Global ESLint version: 8.0.1
Operating System: Windows WSL2 running Ubuntu 20 LTS

What parser are you using?

@typescript-eslint/parser

What did you do?

Configuration
{
  "env": {
    "browser": true,
    "es2021": true
  },
  "extends": [
    "standard-with-typescript",
    "plugin:security/recommended", 
    "prettier"
  ],
  "overrides": [],
  "parserOptions": {
    "ecmaVersion": "latest",
    "sourceType": "module",
    "project": "tsconfig.json"
  },
  "rules": {}
}

private readonly stateValueToEmoji: {
  readonly [stateValue in CloudWatch.StateValue]: string;
} = {
  ALARM: "🔥",
  INSUFFICIENT_DATA: "🤷‍♂️",
  OK: "👌",
};

public sendAlam = (alarm:CloudWatchAlarm) => {
    const previousEmoji = this.stateValueToEmoji[alarm.OldStateValue];
    ...
}

What did you expect to happen?

I expected an "object injection" error to be highlight for this code: const previousEmoji = this.stateValueToEmoji[alarm.OldStateValue];

What actually happened?

Code passed.

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

I'm a total security noob, just trying to get my local configuration to match GitLab so that I can improve the feedback loop. GitLab highlights const previousEmoji = this.stateValueToEmoji[alarm.OldStateValue]; as an "Object Injection" issue.

@nzakas
Copy link
Contributor

nzakas commented Jan 26, 2023

Can you explain a little bit more about your situation? Is GitLab running ESLint or something else? What is the actual output?

FWIW: I'm not sure how well our rules work with TypeScript as it's a different parsing tree.

@nzakas
Copy link
Contributor

nzakas commented Feb 14, 2024

No response, so closing.

@nzakas nzakas closed this as not planned Won't fix, can't repro, duplicate, stale Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants