diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index ba25f29f7b7..ba347b94555 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,52 +1,49 @@ -name: "Code scanning - action" +name: 'Code scanning - action' on: - push: - pull_request: - schedule: - - cron: '0 10 * * 3' + push: + pull_request: + schedule: + - cron: '0 10 * * 3' jobs: - CodeQL-Build: - - # CodeQL runs on ubuntu-latest and windows-latest - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 - - # If this run was triggered by a pull request event, then checkout - # the head of the pull request instead of the merge commit. - - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - # Override language selection by uncommenting this and choosing your languages - # with: - # languages: go, javascript, csharp, python, cpp, java - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + CodeQL-Build: + # CodeQL runs on ubuntu-latest and windows-latest + runs-on: ubuntu-latest + permissions: + security-events: write + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + + + # Override language selection by uncommenting this and choosing your languages + # with: + # languages: go, javascript, csharp, python, cpp, java + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/packages/ra-core/src/controller/index.ts b/packages/ra-core/src/controller/index.ts index 9d3ec219e9e..b097f3a18df 100644 --- a/packages/ra-core/src/controller/index.ts +++ b/packages/ra-core/src/controller/index.ts @@ -29,6 +29,7 @@ import useListSortContext from './useListSortContext'; export type { ListControllerProps, + ListPaginationContextValue, PaginationHookResult, SortProps, UseReferenceProps, @@ -42,7 +43,6 @@ export { ListContext, ListFilterContext, ListPaginationContext, - ListPaginationContextValue, ListSortContext, ListContextProvider, useCheckMinimumRequiredProps, diff --git a/packages/ra-ui-materialui/package.json b/packages/ra-ui-materialui/package.json index 864b8b2871c..2abad67d129 100644 --- a/packages/ra-ui-materialui/package.json +++ b/packages/ra-ui-materialui/package.json @@ -70,6 +70,7 @@ "classnames": "~2.2.5", "connected-react-router": "^6.5.2", "css-mediaquery": "^0.1.2", + "dompurify": "^2.4.3", "downshift": "3.2.7", "inflection": "~1.13.1", "jsonexport": "^2.4.1", diff --git a/packages/ra-ui-materialui/src/field/RichTextField.tsx b/packages/ra-ui-materialui/src/field/RichTextField.tsx index ce9bac06e18..bf9e6a53421 100644 --- a/packages/ra-ui-materialui/src/field/RichTextField.tsx +++ b/packages/ra-ui-materialui/src/field/RichTextField.tsx @@ -4,6 +4,7 @@ import PropTypes from 'prop-types'; import get from 'lodash/get'; import Typography, { TypographyProps } from '@material-ui/core/Typography'; import { useRecordContext } from 'ra-core'; +import purify from 'dompurify'; import sanitizeFieldRestProps from './sanitizeFieldRestProps'; import { InjectedFieldProps, PublicFieldProps, fieldPropTypes } from './types'; @@ -29,7 +30,11 @@ const RichTextField: FC = memo( ) : stripTags ? ( removeTags(value) ) : ( - + )} ); diff --git a/yarn.lock b/yarn.lock index 799698dd5d0..7cb42587268 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8144,6 +8144,11 @@ domhandler@^4.2.0, domhandler@^4.3.0: dependencies: domelementtype "^2.2.0" +dompurify@^2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.4.3.tgz#f4133af0e6a50297fc8874e2eaedc13a3c308c03" + integrity sha512-q6QaLcakcRjebxjg8/+NP+h0rPfatOgOzc46Fst9VAA3jF2ApfKBNKMzdP4DYTqtUMXSCd5pRS/8Po/OmoCHZQ== + domutils@1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf"