Git Product home page Git Product logo

spfx-react-webchat's Introduction

Microsoft Bot Framework Webchat - Sharepoint Web Part

Summary

A web part that acts as a web chat component for bot's built on the Microsoft Bot Framework using the DirectLine API. When sending messages the web part uses the username of the currently logged in user.

Used SharePoint Framework Version

1,11.0

Applies to

Prerequisites

You need to have a bot created and registered using the Microsoft Bot Framework and registered to use the DirectLine Channel, which will give you the secret needed inorder to generate the token when adding this web part to the page. For more information on creating a bot and registering the channel you can see the official web site at dev.botframework.com.

Building the code

  • Clone this repository
  • Update the bot token API endpoint & ResourceId in the manifiest file (BotWebPart.manifest.json)
  • in the command line run:
    • npm install
    • npm install -g gulp
    • gulp serve

This package produces the following:

  • lib/* - intermediate-stage commonjs build artifacts
  • dist/* - the bundled script, along with other resources
  • sharepoint/* - all resources which should be uploaded to a CDN.

Connect Securely

Update the Web part properties to choose one of the following secured bot connectivity options

  • Direct Line Secret
    • Copy the direct line secret from the registered direct line channel.
  • Direct Line Token API
    • Use the bot direct line token API to get the token to securely connect the bot.
  • Custom API Secured by OAuth
    • Use your own custom API secured by OAuth which inturn generates the bot direct line token using the direct line token API.
    • To leverage this connectivity option, please update the following properties in the "BotWebPart.manifest.json" file
      • botTokenApiResourceId
      • botTokenApiUrl

Direct Line Token API and Custom API is the recommended one to more securely connect your bot.

Package Options

  • gulp clean
  • gulp build
  • gulp serve
  • gulp bundle --ship
  • gulp package-solution --ship

Features

This Web Part illustrates the following concepts on top of the SharePoint Framework:

  • Connecting and communicating with a bot built on the Microsoft Bot Framework using the DirectLine Channel
  • Office UI Fabric
  • React

Project

This repo has been populated by an initial template to help get you started. Please make sure to update the content to build a great experience for community-building.

As the maintainer of this project, please make a few updates:

  • Improving this README.MD file to provide a great experience
  • Updating SUPPORT.MD with content about this project's support experience
  • Understanding the security reporting process in SECURITY.MD
  • Remove this section from the README

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

spfx-react-webchat's People

Contributors

dependabot[bot] avatar microsoftopensource avatar namanimsft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

spfx-react-webchat's Issues

PKG:NPM/[email protected]

Package: minimatch
Version: 3.0.4
Description: a glob matcher in javascript

1 non-CVE vulnerability found.

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

PKG:NPM/[email protected]

Package: core-js
Version: 3.6.4
Description: Standard library

1 non-CVE vulnerability found.

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

PKG:NPM/[email protected]

Package: async
Version: 2.6.3
Description: Higher-order functions and common patterns for asynchronous code

In Async before 2.6.4 and 3.x before 3.2.2, a malicious user can obtain privileges via the mapValues() method, aka lib/internal/iterator.js createObjectIterator prototype pollution. Sonatype's research suggests that this CVE's details differ from those defined at NVD.

CVSS Score: 7.8

CVSS Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

PKG:NPM/[email protected]

Package: sanitize-html
Version: 1.27.5
Description: Clean up user-submitted HTML, preserving whitelisted elements and whitelisted attributes on a per-element basis

Apostrophe Technologies sanitize-html before 2.3.1 does not properly handle internationalized domain name (IDN) which could allow an attacker to bypass hostname whitelist validation set by the "allowedIframeHostnames" option.

CVSS Score: 5.3

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N


Apostrophe Technologies sanitize-html before 2.3.2 does not properly validate the hostnames set by the "allowedIframeHostnames" option when the "allowIframeRelativeUrls" is set to true, which allows attackers to bypass hostname whitelist for iframe element, related using an src value that starts with "/\example.com".

CVSS Score: 5.3

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N


The package sanitize-html before 2.7.1 are vulnerable to Regular Expression Denial of Service (ReDoS) due to insecure global regular expression replacement logic of HTML comment removal. Sonatype's research suggests that this CVE's details differ from those defined at NVD.

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H


1 non-CVE vulnerability found.

CVSS Score: 6.1

CVSS Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

PKG:NPM/[email protected]

Package: css-what
Version: 3.4.2
Description: a CSS selector parser

The package css-what before 2.1.3 are vulnerable to Regular Expression Denial of Service (ReDoS) due to the usage of insecure regular expression in the re_attr variable of index.js. The exploitation of this vulnerability could be triggered via the parse function. Sonatype's research suggests that this CVE's details differ from those defined at NVD.

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

PKG:NPM/[email protected]

Package: jsonwebtoken
Version: 8.5.1
Description: JSON Web Token implementation (symmetric and asymmetric)

** REJECT ** DO NOT USE THIS CANDIDATE NUMBER. ConsultIDs: none. Reason: The issue is not a vulnerability. Notes: none. Sonatype's research suggests that this CVE's details differ from those defined at NVD

CVSS Score: 9.8

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H


Versions <=8.5.1 of jsonwebtoken library could be misconfigured so that legacy, insecure key types are used for signature verification. For example, DSA keys could be used with the RS256 algorithm. You are affected if you are using an algorithm and a key type other than a combination listed in the GitHub Security Advisory as unaffected. This issue has been fixed, please update to version 9.0.0. This version validates for asymmetric key type and algorithm combinations. Please refer to the above mentioned algorithm / key type combinations for the valid secure configuration. After updating to version 9.0.0, if you still intend to continue with signing or verifying tokens using invalid key type/algorithm value combinations, you’ll need to set the allowInvalidAsymmetricKeyTypes option to true in the sign() and/or verify() functions.

CVSS Score: 8.1

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N


In versions <=8.5.1 of jsonwebtoken library, lack of algorithm definition in the jwt.verify() function can lead to signature validation bypass due to defaulting to the none algorithm for signature verification. Users are affected if you do not specify algorithms in the jwt.verify() function. This issue has been fixed, please update to version 9.0.0 which removes the default support for the none algorithm in the jwt.verify() method. There will be no impact, if you update to version 9.0.0 and you don’t need to allow for the none algorithm. If you need 'none' algorithm, you have to explicitly specify that in jwt.verify() options.

CVSS Score: 7.6

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:L


jsonwebtoken is an implementation of JSON Web Tokens. Versions <= 8.5.1 of jsonwebtoken library can be misconfigured so that passing a poorly implemented key retrieval function referring to the secretOrPublicKey argument from the readme link will result in incorrect verification of tokens. There is a possibility of using a different algorithm and key combination in verification, other than the one that was used to sign the tokens. Specifically, tokens signed with an asymmetric public key could be verified with a symmetric HS256 algorithm. This can lead to successful validation of forged tokens. If your application is supporting usage of both symmetric key and asymmetric key in jwt.verify() implementation with the same key retrieval function. This issue has been patched, please update to version 9.0.0. Sonatype's research suggests that this CVE's details differ from those defined at NVD. See https://ossindex.sonatype.org/vulnerability/CVE-2022-23541 for details

CVSS Score: 6.3

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L

PKG:NPM/[email protected]

Package: trim-newlines
Version: 1.0.0
Description: Trim newlines from the start and/or end of a string

The trim-newlines package before 3.0.1 and 4.x before 4.0.1 for Node.js has an issue related to regular expression denial-of-service (ReDoS) for the .end() method.

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

PKG:NPM/[email protected]

Package: node-sass
Version: 4.12.0
Description: Wrapper around libsass

Certificate validation in node-sass 2.0.0 to 4.14.1 is disabled when requesting binaries even if the user is not specifying an alternative download path.

CVSS Score: 5.3

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N


1 non-CVE vulnerability found.

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

PKG:NPM/[email protected]

Package: json-schema
Version: 0.2.3
Description: JSON Schema validation and specifications
json-schema is vulnerable to Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
CVSS Score: 9.8
CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

PKG:NPM/[email protected]

Package: validator
Version: 8.2.0
Description: String validation and sanitization

1 non-CVE vulnerability found.

CVSS Score: 7.5
CVSS Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

PKG:NPM/[email protected]

Package: postcss
Version: 7.0.35
Description: Tool for transforming styles with JS plugins

The package postcss from 7.0.0 and before 8.2.10 are vulnerable to Regular Expression Denial of Service (ReDoS) during source map parsing. Sonatype's research suggests that this CVE's details differ from those defined at NVD.

CVSS Score: 5.3

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L


The package postcss before 8.2.13 are vulnerable to Regular Expression Denial of Service (ReDoS) via getAnnotationURL() and loadAnnotation() in lib/previous-map.js. The vulnerable regexes are caused mainly by the sub-pattern /*\s* sourceMappingURL=(.*).

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H


1 non-CVE vulnerability found.

CVSS Score: 6.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

PKG:NPM/[email protected]

Package: is-svg
Version: 3.0.0
Description: Check if a string or buffer is SVG

The is-svg package 2.1.0 through 4.2.1 for Node.js uses a regular expression that is vulnerable to Regular Expression Denial of Service (ReDoS). If an attacker provides a malicious string, is-svg will get stuck processing the input for a very long time.

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

PKG:NPM/[email protected]

Package: ua-parser-js
Version: 0.7.27
Description: Lightweight JavaScript-based user-agent string parser

ua-parser-js - Regular Expression Denial of Service (ReDoS) ua-parser-js - Regular Expression Denial of Service (ReDoS)

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H


1 non-CVE vulnerability found.

CVSS Score: 5.9

CVSS Vector: CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

PKG:NPM/[email protected]

Package: node-fetch
Version: 1.7.3
Description: A light-weight module that brings window.fetch to node.js

node-fetch before versions 2.6.1 and 3.0.0-beta.9 did not honor the size option after following a redirect, which means that when a content size was over the limit, a FetchError would never get thrown and the process would end without failure. For most people, this fix will have a little or no impact. However, if you are relying on node-fetch to gate files above a size, the impact could be significant, for example: If you don't double-check the size of the data after fetch() has completed, your JS thread could get tied up doing work on a large file (DoS) and/or cost you money in computing.

CVSS Score: 5.3

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L


node-fetch is vulnerable to Exposure of Sensitive Information to an Unauthorized Actor

CVSS Score: 6.1

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N


1 non-CVE vulnerability found.

CVSS Score: 3.7

CVSS Vector: CVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N

PKG:NPM/[email protected]

Package: loader-utils
Version: 1.1.0
Description: utils for webpack loaders

A Regular expression denial of service (ReDoS) flaw was found in Function interpolateName in interpolateName.js in webpack loader-utils 2.0.0 via the resourcePath variable in interpolateName.js.

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H


Prototype pollution vulnerability in function parseQuery in parseQuery.js in webpack loader-utils 2.0.0 via the name variable in parseQuery.js.

CVSS Score: 9.8

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H


A Regular expression denial of service (ReDoS) flaw was found in Function interpolateName in interpolateName.js in webpack loader-utils 2.0.0 via the url variable in interpolateName.js.

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

PKG:NPM/[email protected]

Package: merge
Version: 1.2.1
Description: Merge multiple objects into one, optionally creating a new cloned object. Similar to the jQuery.extend but more flexible. Works in Node.js and the browser.

1 non-CVE vulnerability found.

CVSS Score: 8.6

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H

PKG:NPM/[email protected]

Package: tar
Version: 2.2.2
Description: tar for node

The npm package "tar" (aka node-tar) before versions 6.1.1, 5.0.6, 4.4.14, and 3.3.2 has a arbitrary File Creation/Overwrite vulnerability due to insufficient absolute path sanitization. node-tar aims to prevent extraction of absolute file paths by turning absolute paths into relative paths when the preservePaths flag is not set to true. This is achieved by stripping the absolute path root from any absolute file paths contained in a tar file. For example /home/user/.bashrc would turn into home/user/.bashrc. This logic was insufficient when file paths contained repeated path roots such as ////home/user/.bashrc. node-tar would only strip a single path root from such paths. When given an absolute file path with repeating path roots, the resulting path (e.g. ///home/user/.bashrc) would still resolve to an absolute path, thus allowing arbitrary file creation and overwrite. This issue was addressed in releases 3.2.2, 4.4.14, 5.0.6 and 6.1.1. Users may work around this vulnerability without upgrading by creating a custom onentry method which sanitizes the entry.path or a filter method which removes entries with absolute paths. See referenced GitHub Advisory for details. Be aware of CVE-2021-32803 which fixes a similar bug in later versions of tar.

CVSS Score: 8.1

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H


1 non-CVE vulnerability found.

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

PKG:NPM/[email protected]

Package: node-notifier
Version: 5.0.2
Description: A Node.js module for sending notifications on native Mac, Windows (post and pre 8) and Linux (or Growl as fallback)

This affects the package node-notifier before 9.0.0. It allows an attacker to run arbitrary commands on Linux machines due to the options params not being sanitised when being passed an array. Sonatype's research suggests that this CVE's details differ from those defined at NVD.

CVSS Score: 5.6

CVSS Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L

PKG:NPM/[email protected]

Package: execa
Version: 1.0.0
Description: Process execution for humans

1 non-CVE vulnerability found.

CVSS Score: 9.8

PKG:NPM/[email protected]

Package: jszip
Version: 2.5.0
Description: Create, read and edit .zip files with JavaScript http://stuartk.com/jszip

This affects the package jszip before 3.7.0. Crafting a new zip file with filenames set to Object prototype values (e.g proto, toString, etc) results in a returned object with a modified prototype instance. Sonatype's research suggests that this CVE's details differ from those defined at NVD.

CVSS Score: 5.3

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

PKG:NPM/[email protected]

Package: clean-css
Version: 4.2.1
Description: A well-tested CSS minifier

1 non-CVE vulnerability found. To see more details, please create a free account at https://ossindex.sonatype.org/ and request for this information using your registered account

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

PKG:NPM/[email protected]

Package: uglify-js
Version: 3.13.3
Description: JavaScript parser, mangler/compressor and beautifier toolkit

1 non-CVE vulnerability found.

CVSS Score: 5.1

CVSS Vector: CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

PKG:NPM/[email protected]

Package: node-forge
Version: 0.7.6
Description: JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.

The package node-forge before 0.10.0 is vulnerable to Prototype Pollution via the util.setPath function. Note: Version 0.10.0 is a breaking change removing the vulnerable functions.

CVSS Score: 7.3

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L


forge is vulnerable to URL Redirection to Untrusted Site

CVSS Score: 6.1

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N


Forge (also called node-forge) is a native implementation of Transport Layer Security in JavaScript. Prior to version 1.3.0, RSA PKCS#1 v1.5 signature verification code is lenient in checking the digest algorithm structure. This can allow a crafted structure that steals padding bytes and uses unchecked portion of the PKCS#1 encoded message to forge a signature when a low public exponent is being used. The issue has been addressed in node-forge version 1.3.0. There are currently no known workarounds.

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N


Forge (also called node-forge) is a native implementation of Transport Layer Security in JavaScript. Prior to version 1.3.0, RSA PKCS#1 v1.5 signature verification code does not check for tailing garbage bytes after decoding a DigestInfo ASN.1 structure. This can allow padding bytes to be removed and garbage data added to forge a signature when a low public exponent is being used. The issue has been addressed in node-forge version 1.3.0. There are currently no known workarounds.

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N


Forge (also called node-forge) is a native implementation of Transport Layer Security in JavaScript. Prior to version 1.3.0, RSA PKCS#1 v1.5 signature verification code does not properly check DigestInfo for a proper ASN.1 structure. This can lead to successful verification with signatures that contain invalid structures but a valid digest. The issue has been addressed in node-forge version 1.3.0. There are currently no known workarounds.

CVSS Score: 5.3

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N


1 non-CVE vulnerability found.

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

PKG:NPM/[email protected]

Package: json-stable-stringify
Version: 1.0.1
Description: deterministic JSON.stringify() with custom sorting to get deterministic hashes from stringified results

1 non-CVE vulnerability found.

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

PKG:NPM/[email protected]

Package: decode-uri-component
Version: 0.2.0
Description: A better decodeURIComponent

decode-uri-component 0.2.0 is vulnerable to Improper Input Validation resulting in DoS.

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

PKG:NPM/[email protected]

Package: scss-tokenizer
Version: 0.2.3
Description: A tokenzier for Sass' SCSS syntax

All versions of package scss-tokenizer are vulnerable to Regular Expression Denial of Service (ReDoS) via the loadAnnotation() function, due to the usage of insecure regex.

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

PKG:NPM/[email protected]

Package: unset-value
Version: 1.0.0
Description: Delete nested properties from an object using dot notation.

1 non-CVE vulnerability found. To see more details, please create a free account at https://ossindex.sonatype.org/ and request for this information using your registered account

CVSS Score: 9.4

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H

PKG:NPM/[email protected]

Package: react
Version: 16.8.6
Description: React is a JavaScript library for building user interfaces.

1 non-CVE vulnerability found.

CVSS Score: 4.7

CVSS Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N

Unable to successfully run the app

Hi,

I could not run the code on my development machine. May I know what is the recommended versions to use to successfully run the app?

Development environment
NPM v6.14.13
Node v14.17.0
Gulp

  • CLI version: 2.3.0
  • Local version: 3.9.1

Getting this error when I execute gulp serve

ReferenceError: primordials is not defined
    at fs.js:45:5
    at req_ (C:\spfx-react-webchat\node_modules\natives\index.js:143:24)
    at Object.req [as require] (C:\spfx-react-webchat\node_modules\natives\index.js:55:10)
    at Object.<anonymous> (C:\spfx-react-webchat\node_modules\gulp\node_modules\graceful-fs\fs.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:1068:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Module.load (internal/modules/cjs/loader.js:933:32)
    at Function.Module._load (internal/modules/cjs/loader.js:774:14)
    at Module.require (internal/modules/cjs/loader.js:957:19)
    at require (internal/modules/cjs/helpers.js:88:18)

Appreciate any feedback to point me to the right direction

Thanks

PKG:NPM/[email protected]

Package: lodash.template
Version: 3.6.2
Description: The Lodash method _.template exported as a module.

Lodash versions prior to 4.17.21 are vulnerable to Command Injection via the template function.

CVSS Score: 7.2

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H

PKG:NPM/[email protected]

Package: ramda
Version: 0.25.0
Description: A practical functional library for JavaScript programmers.

1 non-CVE vulnerability found.

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

PKG:NPM/[email protected]

Package: underscore
Version: 1.8.3
Description: JavaScript's functional programming helper library.

The package underscore from 1.13.0-0 and before 1.13.0-2, from 1.3.2 and before 1.12.1 are vulnerable to Arbitrary Code Injection via the template function, particularly when a variable property is passed as an argument as it is not sanitized.

CVSS Score: 7.2

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H

facing a webpack error when using with the new version of SharePoint

I am trying to use the webchat package with the new share point version (setup using https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment)
after installation I am facing the following webpack related problem

`[13:51:14] Error - [webpack] 'dist':
./node_modules/htmlparser2/lib/esm/index.js 48:9
Module parse failed: Unexpected token (48:9)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| * They should probably be removed eventually.
| */

export * as ElementType from "domelementtype";
| import { getFeed } from "domutils";
| export { getFeed } from "domutils";
@ ./node_modules/sanitize-html/index.js 1:19-41
@ ./node_modules/botframework-webchat/lib/renderMarkdown.js
@ ./node_modules/botframework-webchat/lib/index.js
@ ./lib/webparts/helloDemo/components/HelloDemo.js
@ ./lib/webparts/helloDemo/HelloDemoWebPart.js
`

This is a vanila installation of sharepoint and botframework webchat.
my package.jon looks like
"dependencies": { "@microsoft/sp-core-library": "1.15.2", "@microsoft/sp-lodash-subset": "1.15.2", "@microsoft/sp-office-ui-fabric-core": "1.15.2", "@microsoft/sp-property-pane": "1.15.2", "@microsoft/sp-webpart-base": "1.15.2", "botframework-webchat": "^4.15.9", "office-ui-fabric-react": "7.185.7", "react": "16.13.1", "react-dom": "16.13.1", "tslib": "2.3.1" }, "devDependencies": { "@microsoft/eslint-config-spfx": "1.15.2", "@microsoft/eslint-plugin-spfx": "1.15.2", "@microsoft/rush-stack-compiler-4.5": "0.2.2", "@microsoft/sp-build-web": "1.15.2", "@microsoft/sp-module-interfaces": "1.15.2", "@rushstack/eslint-config": "2.5.1", "@types/react": "16.9.51", "@types/react-dom": "16.9.8", "@types/webpack-env": "~1.15.2", "ajv": "^6.12.5", "eslint-plugin-react-hooks": "4.3.0", "gulp": "4.0.2", "typescript": "4.5.5" }
and the webpart is simple
` const [token, setToken] = useState('');

useEffect(() =>
{
  const loadToken = async (): Promise<void> =>
  {
    const res = await fetch('https://webchat-mockbot.azurewebsites.net/directline/token', { method: 'POST' });
    const { token } = await res.json();
    setToken(token);
  };
  loadToken().then(()=> console.log('token loaded')).catch(console.error);
  return () =>
  {
    console.log('unmount');
   // setToken('');
  };
}, []);

`

PKG:NPM/[email protected]

Package: nwsapi
Version: 2.2.0
Description: Fast CSS Selectors API Engine

1 non-CVE vulnerability found.

CVSS Score: 6.2

CVSS Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

PKG:NPM/[email protected]

Package: minimist
Version: 1.2.5
Description: parse argument options

Minimist <=1.2.5 is vulnerable to Prototype Pollution via file index.js, function setKey() (lines 69-95).

CVSS Score: 9.8

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

PKG:NPM/[email protected]

Package: nth-check
Version: 1.0.2
Description: performant nth-check parser & compiler

nth-check is vulnerable to Inefficient Regular Expression Complexity

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

PKG:NPM/[email protected]

Package: prompts
Version: 0.1.14
Description: Lightweight, beautiful and user-friendly prompts

** REJECT ** DO NOT USE THIS CANDIDATE NUMBER. ConsultIDs: none. Reason: The CNA or individual who requested this candidate did not associate it with any vulnerability during 2021. Notes: none.

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

PKG:NPM/[email protected]

Package: qs
Version: 6.5.2
Description: A querystring parser that supports nesting and arrays, with a depth limit

qs before 6.10.3, as used in Express before 4.17.3 and other products, allows attackers to cause a Node process hang for an Express application because an __ proto__ key can be used. In many typical Express use cases, an unauthenticated remote attacker can place the attack payload in the query string of the URL that is used to visit the application, such as a[proto]=b&a[proto]&a[length]=100000000. The fix was backported to qs 6.9.7, 6.8.3, 6.7.3, 6.6.1, 6.5.3, 6.4.1, 6.3.3, and 6.2.4 (and therefore Express 4.17.3, which has "deps: [email protected]" in its release description, is not vulnerable). Sonatype's research suggests that this CVE's details differ from those defined at NVD.

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

PKG:NPM/[email protected]

Package: ws
Version: 7.4.4
Description: Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js

ws is an open source WebSocket client and server library for Node.js. A specially crafted value of the Sec-Websocket-Protocol header can be used to significantly slow down a ws server. The vulnerability has been fixed in [email protected] (websockets/ws@00c425e). In vulnerable versions of ws, the issue can be mitigated by reducing the maximum allowed length of the request headers using the --max-http-header-size=size and/or the maxHeaderSize options.

CVSS Score: 5.3

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

PKG:NPM/[email protected]

Package: request
Version: 2.88.2
Description: Simplified HTTP request client.

1 non-CVE vulnerability found.

CVSS Score: 5.9

CVSS Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N

PKG:NPM/[email protected]

Package: typescript
Version: 3.3.4000
Description: TypeScript is a language for application scale JavaScript development

Visual Studio Code Remote Code Execution Vulnerability
CVSS Score: 7.8

CVSS Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Security Issue with "trim"

Hi,
according to the code and dependencies analysis there is a security issue in the bot Framework in use.
image

Upgrading bot Framework caused other problems. Please fix this security issue.
Thanks.

PKG:NPM/[email protected]

Package: ajv
Version: 5.2.5
Description: Another JSON Schema Validator

An issue was discovered in ajv.validate() in Ajv (aka Another JSON Schema Validator) 6.12.2. A carefully crafted JSON schema could be provided that allows execution of other code by prototype pollution. (While untrusted schemas are recommended against, the worst case of an untrusted schema should be a denial of service, not execution of code.) Sonatype's research suggests that this CVE's details differ from those defined at NVD.

CVSS Score: 5.6

CVSS Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L

PKG:NPM/[email protected]

Package: ansi-regex
Version: 4.1.0
Description: Regular expression for matching ANSI escape codes

ansi-regex - Regular Expression Denial of Service (ReDoS) [CVE-2021-3807] ansi-regex - Regular Expression Denial of Service (ReDoS) [CVE-2021-3807]

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

PKG:NPM/[email protected]

Package: markdown-it
Version: 12.0.2
Description: Markdown-it - modern pluggable markdown parser.

markdown-it - Regular expression Denial of Service (ReDoS) markdown-it - Regular expression Denial of Service (ReDoS)

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

PKG:NPM/[email protected]

Package: html-minifier
Version: 3.5.21
Description: Highly configurable, well-tested, JavaScript-based HTML minifier.

A Regular Expression Denial of Service (ReDoS) flaw was found in kangax html-minifier 4.0.0 via the candidate variable in htmlminifier.js.

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

PKG:NPM/[email protected]

Package: express
Version: 4.16.4
Description: Fast, unopinionated, minimalist web framework

qs before 6.10.3, as used in Express before 4.17.3 and other products, allows attackers to cause a Node process hang for an Express application because an __ proto__ key can be used. In many typical Express use cases, an unauthenticated remote attacker can place the attack payload in the query string of the URL that is used to visit the application, such as a[proto]=b&a[proto]&a[length]=100000000. The fix was backported to qs 6.9.7, 6.8.3, 6.7.3, 6.6.1, 6.5.3, 6.4.1, 6.3.3, and 6.2.4 (and therefore Express 4.17.3, which has "deps: [email protected]" in its release description, is not vulnerable). Sonatype's research suggests that this CVE's details differ from those defined at NVD.

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H


1 non-CVE vulnerability found.

CVSS Score: 7.5

CVSS Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

PKG:NPM/[email protected]

Package: terser
Version: 4.8.0
Description: JavaScript parser, mangler/compressor and beautifier toolkit for ES6+

The package terser before 4.8.1, from 5.0.0 and before 5.14.2 are vulnerable to Regular Expression Denial of Service (ReDoS) due to insecure usage of regular expressions. Sonatype's research suggests that this CVE's details differ from those defined at NVD.

CVSS Score: 7.5

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

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.